Share this article
Improve this guide
How to use net user command in Windows 10,8,7
7 min. read
Updated onOctober 4, 2023
updated onOctober 4, 2023
Share this article
Improve this guide
Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more
Many advanced users and administrators useCommand Promptto perform various actions. Speaking of which, today we’re going to explain how net user command works and what you can do with it onWindows 10.
What is net user command and how does it work?
Net user command was first introduced inWindows Vista, and it has been a part of Windows ever since. The command allows you to create and modify user accounts on your PC. To use this command, you need to startCommand Promptas an administrator. The fastest way to do that is to pressWindows Key + Xto openWin + X menuand then chooseCommand Prompt (Admin)from the menu.
When you enternet userin Command Prompt, you’ll see a list of available accounts on your PC.Of course, you can view detailed information regarding available user accounts on your PC. To do that, simply enternet user desired_usernameand pressEnter.By using this command you can see the full name of the user account as well as additional information. You can see if the account isprotected by a passwordand even the time when the password was set. In addition, you can see to which groups the selected user account belongs to.
Using this command you can also set passwords for accounts on your PC. To do that, you just have to enternet user desired_username *. Now you’ll be prompted to enter the desired password and retype it to confirm the change.
If you want to set an account password more quickly, you just need to enternet user desired_username yournewpassword
In addition to changing passwords, you can also easily add new accounts to your PC using thenet usercommand. To do that, you just have to enternet user name_of_the_new_account /add.
If needed, you can add password to your account while creating it using thenet user name_of_the_new_account mypassword /addcommand. Of course, you can also use thenet user new_user_name * /addcommand to create a new user account with a password.
Using this command you can also set your account to active or inactive. Basically, if you set your account to inactive other users won’t be able to see it or access it without using net user command. To hide an account, you just have to enternet user account_name /active:no. After doing that, the selected account will become hidden and you won’t be able to access it.
Of course, you can always make account accessible by enteringnet user account_name /active:yescommand. Net user also allows you to assign comments to user accounts. Thanks to this feature, you can add a 48-character comment to any account in order to differentiate it from others. If you’re a system administrator and you’re managing several accounts, this can be incredibly useful. To add a comment, just enternet user account_name /comment:”Commentmessage”.
Using this command you can also set a country code for any account on your PC. This means you can change the language for Help and error messages on any user account. All users have 000 country code as default, but you can easily change it with this command. To change the country code of a specific user, enternet user user_name /countrycode:123and pressEnter. Of course, be sure to replace 123 with an actual country code.
It’s also worth mentioning that you can set any account to expire by using this command. The base structure for this command isnet user user_name /expires:MM/DD/YYYY, but you can also use DD/MM/YYYY format as well. It’s worth mentioning that you can use three types of values for months. You can use the full name of the month, a three letter abbreviation or just a number. As for year, you can use two-digit or four-digit values.
Of course, you can also set your account to never expire by using the/expire:never parameter.
You can also set a full name for any user on your PC. If you’re managing several users, this command will allow you to differentiate them using their real name. To assign a full name to a user, you just have to enternet user user_name /fullname:”User’s full name”.
Since many users tend to use passwords to protect their accounts, as a system administrator you can allow or prevent users from changing theiraccount password. Thanks to this feature you’ll prevent users from changing their password without your knowledge. To prevent a specific user from changing its password you need to usenet user user_name /passwordchg:nocommand.
If you want to allow users to change their password, you need to usenet user user_name /passwordchg:yescommand instead.
As we already mentioned, using a password is important if you want to protect your account, and with net user command you can force individual users to use a password. By doing that you’ll minimize the chance for unauthorized access. To force a user to use a password on his account, you need to usenet user user_name /passwordreq:yescommand. Of course, you can usenet user user_name /passwordreq:nocommand to remove this requirement.
Net user command also allows you to specify the time period in which the user can use its account. This feature is especially useful if you want to set time restrictions for specific users. To restrict access for a specific user, you need to specify time frame for each day.
You can enter the full name of the day or use the abbreviation. As for the time, you can use 12-hour or 24-hour format. To set a time restriction for a user, you need to usenet user user_name /time:M-F,08:00-17:00. Of course, you can use a different format so your command will look likenet user user_name /time:M-F,8AM-5PM.
If needed, you can also set different time frame for different days by usingnet user user_name /time:M,4AM-5PM;T,1PM-3PM;W-F,8:00-17:00.
You can prevent users from permanently logging to their account on specific days simply by leaving the value blank. If you want to remove all time restrictions for a specific account, simply enternet user user_name /time:all. As you can see, this is a rather powerful command, but it only works with one hour increments and that’s its biggest flaw. Nevertheless, this command is extremely useful if you want to restrict computer usage.
Using this command you can also add a user comment for the account in order to differentiate it from others. To do that, usenet user user_name /usercomment:”Your comment”command.
Net user command also allows you to set a home directory for your account by using/homedirparameter. You can also set a logon script for a user using the/scriptpathoption. If needed, you can also specify profile path using/profilepathparameter.
Net user command is rather powerful and it allows you to manage user accounts on your PC. The command is relatively simple to use and we hope that our article helped you understand it a bit better.
READ ALSO:
More about the topics:command prompt
Milan Stanojevic
Windows Toubleshooting Expert
Milan has been enthusiastic about technology ever since his childhood days, and this led him to take interest in all PC-related technologies. He’s a PC enthusiast and he spends most of his time learning about computers and technology.
Before joining WindowsReport, he worked as a front-end web developer. Now, he’s one of the Troubleshooting experts in our worldwide team, specializing in Windows errors & software issues.
User forum
0 messages
Sort by:LatestOldestMost Votes
Comment*
Name*
Email*
Commenting as.Not you?
Save information for future comments
Comment
Δ
Milan Stanojevic
Windows Toubleshooting Expert
Before joining WindowsReport, he worked as a front-end web developer. Now, he’s specialized in Windows errors & software issues.