Manipulating Users and Groups with the net Command
You can also use the net command to create, modify, and delete users and groups. The following table shows some of the common commands.
net Command
Description
Create user.
net userusername password/add
c:\>net user Darril P@ssw0rd /add
Creates a new user with the specified name and password. The password must meet the password requirements of the system.
If the command is executed on a local computer, it creates a local user account. If the command is executed on a domain controller, it creates an account in the Users container of Active Directory unless the redirusr command has changed the default location.
Create local group.
net localgroupgroupname/add
c:\>net localgroup ITPros /add
Creates a local group with the group name. The group is created using the case specified in the command but can be identified later using any case.
Create group on domain controller.
net groupgroupname/add
c:\>net group ITPros /add
Creates a global security group using the group name. The group is added to the Users container.
Note
group works only on a domain controller and localgroup works only on a nondomain controller.
You can use the net localgroup command to add a user or group to an existing group.
The examples add a user account (Darril) and a group (ITPros) to the preexisting event log readers group.
Delete user.
net userusername/delete
c:\>net user Darril /delete
Deletes the specified user account.
Delete local group.
net localgroupgroupname/delete
c:\>net localgroup itpros /delete
Deletes the specified local group.
Delete group on domain controller.
net groupgroupname/delete
c:\>net group itpros /delete
Deletes the specified domain group.
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.