Manage user accounts with NET USER command

Net User command can be used to create, delete or modify user account on a computer or in a domain. Its a built in tool in Windows Severs and Desktops operating systems.

  • When you use this command without any switch, it displays the list of uses on a local computer.
  • To use use the command again Domain, use the /DOMAIN switch

Following tasks can be performed with the net user command:

  • List all the users
  • List user account information
  • Create a user account
  • Change Password
  • Delete a user account

List all the users

To list all the users on a computer: NET USER

Show User Account Details

To list all the use account information, use the following command: NET USER <User ID> [OPTIONS] [/DOMAIN]

Example: The command below will display all information about user account ‘John’ that exist on local computer.


To list information of an account that exist in Active Directory, just add the switch /DOMAINNET USER <User ID> /DOMAIN


The above command shows details like:

User name, Full name, Account expires on, Password Last set, Password Required, Account active, Comments, User profile, Home Directory, Last logon, Logon hours allowed, Local group membership etc.

Create User account

We have two options to create a user account. We can either provide the user account password in the command itself or can have separate prompt to enter the password. The command to create a user account is:

NET USER <User ID> <Password> /ADD [/DOMAIN] [OPTIONS]

ORNET USER <User ID> * /ADD [/DOMAIN] [OPTIONS]Providing the Asterik (*) symbol makes the command prompt you for the password. Please note, if you do not enter password or the Asterik, then the command will create a user account with blank password!


Following command will create a user John with password as ‘P@$$w0rd’

NET USER John P@$$w0rd /ADD

Alternatively, You can use the following command without Password. You need to add Asterik (*) for password and the command will prompt you for password:


Change User Account Password

To change the user account password, type either of the commands:

NET USER <User ID> <Password> [/DOMAIN]



NET USER John NewP@$$w0rd /DOMAIN

Note: Use the /DOMAIN switch if the user account is in AD. If the account is local computer, omit the switch.

[Options] Switches Available for NET USER Command

SwitchOptionsDescriptionIf Omitted, The Default value is:
/active:YES | NOActivates or deactivates the accountYES
/comment:Text enclosed in quotes.Provides a descriptive comment about the user’s accountBlank
/expires:date | neverDate on which the account will expire. If mentioned never, the account will never expire.Never
/fullname:Text enclosed in quotes.First and Last name of the userBlank
/scriptpath:PathSets the path for user logon scriptBlank
/homedir:PathSets the path for the user’s home directoryBlank
/passwordchg:Yes | NoSpecifies if the user can change password.Yes
/passwordreqYes | NoSpecifies if user account must have passwordYes
/profilepath:PathSets the users logon profile%profile% value
/times:Times | AllValues can be [Day, Day, Time, Time]. Days can be spelled completely or abbreviated (Su, M, T, W, Th, F, Sa). Time can be in 12/24 hour format and is limited to 1 hour increment.All
/usercomment:Text enclosed in quotes.Specifies that an administrator can add or change the “User comment” for the accountBlank
/workstations:Computername | *Computers to which user can logon. Maximum 8 computers can be mentioned. IF Asterik is provided, it means user is allowed to logon to all the computer system* (All)

Delete A User Account

To delete the user account, the command: NET USER <User ID> /DELETE [DOMAIN]