How to add users in a group for AD server using command line
Hi,
I want to share Information on how to add users in a group using command line.
Pre-requisite: Users should be created in AD respective to the groups delegated.
1. Run command prompt using administrative privileges (Run as administrator).
2. To view the existing groups in AD use command - net localgroup
For example: Running net localgroup shows the following local groups on my system.
Output:
3. To know the list of members of a group - net localgroup groupName
For example: To get the list of all remote desktop users on a system we can run the below command.
net localgroup "Remote Desktop users"
Output:
4. To add a new user to the group - net localgroup group_name UserLoginName /add
For example to add a user 'user1' to Remote Desktop users group, we can run the below command.
net localgroup "Remote desktop users" user1 /add
Output:
Note: To add any user in Remote desktop users, the server should be enabled with that Remote Desktop services role.
Regards
Chaitanya



0 comments:
Post a Comment