|

How To Use The Net User Command In Windows (2026)

Net user is a built-in Windows command for viewing and managing user accounts from the command line.

You can list accounts, add or remove one, and turn an account on or off.

This guide sticks to the parameters Microsoft documents.

Table of Contents

Net user quick answer

Run net user in Command Prompt to list the user accounts on the PC, and net user followed by a name to see that account.

Add /add, /delete or /active to change an account.

GoalCommand
List all local accountsnet user
Show one accountnet user tommyh
Add an accountnet user jays * /add
Delete an accountnet user jays /delete
Disable an accountnet user jays /active:no
Enable an accountnet user jays /active:yes

What the net user command does

Microsoft says the net user command adds, modifies or deletes user accounts and displays detailed information about them.

It works on a local computer or on a domain.

Microsoft lists Windows 11 and Windows 10 among the systems it applies to.

Before you start

Changing accounts can lock people out, so check the name you type before you press Enter.

Microsoft says a user name can have as many as 20 characters.

  1. Select Start and type Command Prompt.
  2. Open the Command Prompt result.
  3. Type the command you need and press Enter.

List accounts and view one account

Running net user with nothing after it displays a list of all user accounts for the local computer.

net user

Add a user name to display information about that one account, as in Microsoft’s example for the account TommyH.

net user tommyh

Add a user account

The /add parameter adds a new user account.

Without /domain the account is created on the local machine, and with /domain it is created on the domain instead.

  1. Open Command Prompt.
  2. Type net user jays * /addand press Enter.
  3. Type the password when prompted and confirm it.

Microsoft says an asterisk in place of the password gives you a prompt, and the password is not displayed as you type it.

Replace jays with the user name you want.

Password rules

Microsoft states that a password must meet the minimum length set with the net accounts /minpwlen command.

A password can have up to 127 characters.

Typing the password directly in the command shows it on screen and in your command history, so the asterisk prompt is the safer choice.

Delete a user account

The /delete parameter deletes the specified user account.

With /domain the account is deleted from the domain rather than the local machine.

net user jays /delete

Check the name first by running net user to list the accounts.

Disable or enable an account

The /active parameter turns an account on or off.

Microsoft says an inactive account cannot access resources on the computer, and the default is yes.

CommandResult
net user jays /active:noAccount is disabled
net user jays /active:yesAccount is enabled

Limit sign-in hours with /times

The /times parameter sets the days and times when a user can sign in.

Times must be in one-hour increments, days can be spelled out or abbreviated (M, T, W, Th, F, Sa, Su), and hours can use 12-hour or 24-hour format.

Use all to allow sign-in at any time, or leave the value blank to prevent sign-in entirely.

Separate days and times with commas and separate several entries with semicolons, with no spaces in the time.

net user miked /times:M-F,8AM-5PM

Microsoft’s own examples on that page write /time, while its syntax and parameter table define /times, so use /times.

Account options

OptionWhat it does
/comment:”text”Adds a comment of up to 48 characters in double quotes
/fullname:”name”Sets the full name instead of the user name
/expires:date or neverSets the account expiration date; never is the default
/homedir:pathSets the home directory path, which must exist
/passwordchg:yes or noWhether users can change their own password; default yes
/passwordreq:yes or noWhether the account must have a password; default yes
/profilepath:pathSets the sign-in profile path
/scriptpath:pathRelative path to the sign-in script
/usercomment:”text”Lets an administrator add or change the user comment
/workstations:names or *Up to eight computers the user can sign in from
/countrycode:NNNSelects language files for help and error messages; 0 is the default

A full example from Microsoft

Microsoft shows how to add an account for Jay Samson with sign-in rights from 8 AM to 5 PM, Monday through Friday, a mandatory password and the full name.

net user jays Cyk4^g3B /add /passwordreq:yes /times:monday-friday,8am-5pm /fullname:"Jay Jamison"

That example puts the password in the command, so use the asterisk prompt on your own PC.

Set an expiration date

The /expires option sets the date when the account expires, or never, which is the default.

Microsoft says the account expires at the beginning of the date you give.

The month can be a number, a full name such as January or a three-letter abbreviation such as Jan, and the year can have two or four digits.

Use commas or slashes as separators and no spaces, and note that the date format depends on the country or region code.

net user jays /expires:never

Restrict where an account can sign in

The /workstations option lists up to eight computers from which the user can sign in to the network, separated by commas.

If you leave the list out or use an asterisk, the user can sign in from any computer.

Local account or domain account

Command ends withWhere it runs
Nothing extraOn the local computer
/domainOn the domain controller in the computer’s primary domain

Microsoft says /domain applies the operation to the domain instead of the local machine.

Syntax forms

FormUse
net user [UserName {Password | *} [Options]] [/domain]View or modify
net user UserName {Password | *} /add [Options] [/domain]Add
net user UserName [/delete] [/domain]Delete
net user username [/times:{times | all}]Set sign-in hours
net user username [/active:{yes | no}]Enable or disable

For another command that works with other PCs, read our Net Use command guide for the sister command that connects to shared resources.

You can also open PowerShell and check its version if you prefer working there.

Our Tasklist and Taskkill guide covers another everyday Windows command-line tool.

Sources

Microsoft Learn: net user.

Microsoft Learn: Command-Line Syntax Key.

Leave a Reply

Your email address will not be published. Required fields are marked *