The net user command is used to add, remove, and make changes to the user accounts on a computer, all from the Command Prompt.
The net user command is one of many net commands.
Net User Command Availability
The net user command is available from within the Command Prompt in most versions of Windows including Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server operating systems, and some older versions of Windows, too.
You can also use net users in place of net user. They’re completely interchangeable.
Net User Command Syntax
net user [username [password | *] [/add] [options]] [/domain]] [username [/delete] [/domain]] [/help] [/?]
The availability of certain net user command switches and other net user command syntax may differ from operating system to operating system.
See How to Read Command Syntax if you’re not sure how to read the net user command syntax explained above or in the table below.
[1] Windows 98 and Windows 95 only support passwords up to 14 characters long. If you’re creating an account that might be used from a computer with one of those versions of Windows, consider keeping the password length within the requirements for those operating systems.
The following options are to be used where options is noted in the net user command syntax above:
[2] The default home directory is C:\Users\ in Windows 10, Windows 8, Windows 7, and Windows Vista. In Windows XP, the default home directory is C:\Documents and Settings\. For example, if the user account on a Windows 8 tablet is named “Tim,” the default home directory created when the account was the first setup was C:\Users\Tim.
You can store the output of whatever is shown on the screen after running the net user command by using a redirection operator. See How to Redirect Command Output to a File for instructions.
Net User Command Examples
This first example of the net user command shows that at its simplest form, it will produce a list of all the users on the computer, much like this:
Administrator Amy AndyAnette Bill CarolCole DefaultAccount GraceGuest Jasmine JasonJeff jonfi JoshuaMark Martha StacySusan Tim TomTrenton WDAGUtilityAccountThe command completed successfully.
This computer has over a dozen user accounts, so they’re separated into multiple columns.
net user administrator
In this net user example, the command produces all the details on the administrator user account. Here’s an example of what might display:
User name AdministratorFull NameComment Built-in account for administering the computer/domainUser’s commentCountry code 000 (System Default)Account active NoAccount expires NeverPassword last set 1/16/2019 7:43:03 AMPassword expires NeverPassword changeable 1/16/2019 7:43:03 AMPassword required YesUser may change password YesWorkstations allowed AllLogon scriptUser profileHome directoryLast logon 1/16/2019 7:41:15 AMLogon hours allowed AllLocal Group Memberships *Administrators *HomeUsersGlobal Group memberships *None
As you can see, all the details for the administrator account on this Windows 7 computer are listed.
net user rodriguezr /times:M-F,7AM-4PM;Sa,8AM-12PM
Here’s an example where I, presumably someone responsible for this user account [rodriguezr], make a change to the days and times [/times] that this account is able to log on to Windows: Monday through Friday [M–F] from 7:00am to 4:00pm [7AM–4PM] and on Saturday [Sa] from 8:00am to noon [8AM–12PM].
net user nadeema r28Wqn90 /add /comment:“Basic user account.” /fullname:“Ahmed Nadeem” /logonpasswordchg:yes /workstations:jr7tww,jr2rtw /domain
We thought we’d throw the kitchen sink at you with this example. This is the kind of net user application that you might never do at home, but you might very well see in a script published for a new user by the IT department in a company.
Here, we’re setting up a new user account [/add] with the name nadeema and setting the initial password as r28Wqn90. This is a standard account in our company, which we note in the account itself [/comment:“Basic user account.”], and is the new Human Resources executive, Ahmed [/fullname:“Ahmed Nadeem”].
We want Ahmed to change his password to something he won’t forget, so we want him to set his own the first time he logs on [/logonpasswordchg:yes]. Also, Ahmed should only have access to the two computers in the Human Resources office [/workstations:jr7twwr,jr2rtwb]. Finally, our company uses a domain controller [/domain], so Ahmed’s account should be set up there.
As you can see, the net user command can be used for a lot more than simple user account adds, changes, and removals. We configured several advanced aspects of Ahmed’s new account right from the Command Prompt.
net user nadeema /delete
Now, we’ll finish off with an easy one. Ahmed [nadeema] didn’t work out as the latest HR member, so he was let go and his account removed [/delete].
Net User Related Commands
The net user command is a subset of the net command and so is similar to its sister commands like net use, net time, net send, net view, etc.
Get the Latest Tech News Delivered Every Day
Net Send Command
How to Use the Net Use Command in Windows
Net Command
How to Reset a Windows Vista Password
Copy Command
Xcopy Command
Rename Command
More Command
Vol Command Examples and Options
Sfc Command (System File Checker)
Msg Command (Examples, Switches, and More)
How to Redirect Command Output to a File
How to Use the Netstat Command
How to Set Up Auto Login in Windows
How to Open an Elevated Command Prompt
How to Change Another User’s Password in Windows
Facebook
Twitter
Hit Refresh on Your Tech News
About Us
Privacy Policy
Editorial Guidelines
Terms of Use
Careers
Advertise
Contact
EU Privacy
NEWS
HOW TO
FEATURES
ABOUT US