Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3. Manipulating Files, Folders, ... > Manipulating Users and Groups with t...

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 CommandDescription
Create user.
net user username 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 localgroup groupname /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 group groupname /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.

Add user (or group) to group.
c:\>net localgroup "event log
readers" Darril /add
c:\>net localgroup "event log
readers" ITPros /add

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 user username /delete
c:\>net user Darril  /delete

Deletes the specified user account.
Delete local group.
net localgroup groupname /delete
c:\>net localgroup itpros  /delete

Deletes the specified local group.
Delete group on domain controller.
net group groupname /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.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint