For local groups:
To list members of the local group "administrators":
net localgroup administrators
To add "jbloggs" to the local group "administrators":
net localgroup administrators jbloggs /add
To remove "jbloggs" from the local group "administrators":
net localgroup administrators jbloggs /delete
For domain groups:
To list members of the group "Domain Admins":
net group "Domain Admins"
To add "jbloggs" to the group "Domain Admins":
net group "Domain Admins" jbloggs /add /domain
To create a new user "jbloggs":
net user jbloggs MyPassword123 /add /domain
No comments:
Post a Comment