none
Using the command line, How to apply admin rights (privileges) to the user?

    Question

  • Hello everyone,

    Windows Server 2012 R2 , Active Directory

    Sometimes I need to give Admin Rights (Privileges) to the user, so he/she can install Software, Applications, Run as Administrator, etc. on his/her laptop.

    The laptop is already bind to the Active Directory.

    With the GUI this is what I do and it work great, no problem:

    Start MMC
    File
    Add Remove Snap In
    Local user and Group
    Add
    Save Console to the Desktop

    Right Click the Console that I just saved before and select Run as Administrator
    I put my credentials, because I am a Domain Admins user.
    I select Local Groups
    Groups
    Administrator
    and final I add the user name as administrator for his/her laptop
    I select Ok and Apply and thats it.


    Question…..how can I do all the above with the command line?

    Thank you so much and thank you so much in advance for your help
    • Moved by nzpcmad1 Monday, January 9, 2017 5:54 PM From ADFS
    Monday, January 9, 2017 4:43 PM

All replies

  • If you want to do it via cmd prompt:
    net localgroup administrators domainname\username /add

    But this is mainly a question for AD DS or something.
    Not ADFS, so you might get a better answer if you post you question there.

    Monday, January 9, 2017 4:56 PM
  • Hello everyone,

    Windows Server 2012 R2 , Active Directory

    Sometimes I need to give Admin Rights (Privileges) to the user, so he/she can install Software, Applications, Run as Administrator, etc. on his/her laptop.

    The laptop is already bind to the Active Directory.

    With the GUI this is what I do and it work great, no problem:

    Start MMC
    File
    Add Remove Snap In
    Local user and Group
    Add
    Save Console to the Desktop

    Right Click the Console that I just saved before and select Run as Administrator
    I put my credentials, because I am a Domain Admins user.
    I select Local Groups
    Groups
    Administrator
    and final I add the user name as administrator for his/her laptop
    I select Ok and Apply and thats it.


    Question…..how can I do all the above with the command line?

    Thank you so much and thank you so much in advance for your help
    Monday, January 9, 2017 6:37 PM
  • Thanks Jorrk,  I just posted the same question under the Directory Service.  Let's hope someone give me a real scenario example so I can understand.  Thank you a lot.
    Monday, January 9, 2017 6:38 PM
  • Jorrk already answer your question. This is also another way to do it: https://mcpmag.com/articles/2015/05/28/managing-local-groups-in-powershell.aspx

    This posting is provided AS IS with no warranties or guarantees , and confers no rights.

    Ahmed MALEK

    My Website Link

    My Linkedin Profile

    My MVP Profile

    Tuesday, January 10, 2017 12:50 AM
  • Duplicate: https://social.technet.microsoft.com/Forums/windowsserver/en-US/3bd01107-f592-4306-8f8e-af540f393b64/using-the-command-line-how-to-apply-admin-rights-privileges-to-the-user?forum=winserverDS#ca25288e-9697-42ee-a3b6-95abe92b6f4d


    This posting is provided AS IS with no warranties or guarantees , and confers no rights.

    Ahmed MALEK

    My Website Link

    My Linkedin Profile

    My MVP Profile

    Tuesday, January 10, 2017 12:50 AM
  • Hi,

    >> Question…..how can I do all the above with the command line?

    $users = Get-ADUser -Filter * -SearchBase "<Your user's OU>" | select -Property name
    Add-ADGroupMember -Identity "<admin group name>" -Members "$users"

    You need AD module, could be do via installing RSAT tool:

    https://www.microsoft.com/en-us/download/details.aspx?id=45520

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, January 10, 2017 1:42 AM
    Moderator