We can create a user group on the local computer from Windows command line using ‘net localgroup‘ command.
net localgroup group-name /add
To add a new group ‘Group1‘
C:\>net localgroup Group1 /add The command completed successfully. C:\>
To delete a user group:
net localgroup group-name /delete
For example to delete the user group Group1 created in the above example, we can run the below command.
net localgroup Group1 /delete
Net localgroup command can be used on the local computers whereas net group command can be used on domain controller machines.
Rename a local user group:
net localgroup command does not have any option to rename a group. We can use wmic command to rename a group. Below is the command for this.
wmic group where "name='groupname' " call rename newgroupname
Ex: Rename the group ‘group1’ as ‘group2’
wmic group where "name='group1' " call rename group2