We can add a new group to a standalone computer system or a domain from command line. We can use net localgroup and net group commands for this.
For example to add new group with the name say XPUSERS to the local computer system we can run the below command.
net localgroup XPUSERS /add
If you do not have administrator privileges on the computer, you would get the following error when you try to create a local group on the computer.
C:\>net localgroup xpusers /add System error 5 has occurred. Access is denied. C:\>
Add description of the group in the comment
You can specify the description of the group while creating the group. See the example given below.
net localgroup XPUSERS /add /comment:"This is group for XP users"
Add group to the domain or active directory
If you have admin privileges on the domain, you can create domain groups(also called global groups) from any member machine of the domain. The command for this is given below.
net group groupname /add
Related Posts:
List user groups
Remove a user from group