HOWTO: Add local group member


Learn how to add user to a group from windows command line. You need to run the below steps.


1. Open command line:

   - Open elevated command prompt.

2. Run the below command:

   - net localgroup group_name UserLoginName /add
For example to add a user ‘John’ to administrators group, we can run the below command:
net localgroup administrators John /add

3. To add a domain user to local users group:

   - net localgroup users domainname\username /add
This command should be run when the computer is connected to the network. Otherwise you will get the below error.
H:\>net localgroup users domain\user /add
System error 1789 has occurred.
The trust relationship between this workstation and the primary domain failed

4. To add a domain user to local administrator group:

   - net localgroup administrators domainname\username /add

5. To add a user to remote desktop users group:

   - net localgroup "Remote Desktop Users" UserLoginName /add

6. To add a user to debugger users group:

   - net localgroup "Debugger users" UserLoginName /add

7. To add a user to Power users group:

   - net localgroup "Power users" UserLoginName /add

8. To list the users belonging to a particular group:

   - To list the users belonging to a particular group we can run the below command:
net localgroup group_name

Also consider using Action1 to add local group member if:
- You need to perform this action on multiple (hundreds or even thousands) computers simultaneously.
- Some of your endpoints are laptops not connected to corporate network at all times.

Action1 is a cloud-based platform for software deployment, software/hardware inventory, patch management, endpoint configuration and more. It is free with basic functionality.


Other Relevant HOWTOs: