How to Use Net User Command | Full Guide

Looking to take control of user accounts in Windows without clicking through endless menus? Learning how to use Net User Command will change the way you manage your system. This powerful little command lets you add, modify, or remove users’ right from the command line—fast and clean. It doesn’t matter whether you are establishing a new PC or clearing the unnecessary accounts, knowing how to use Net User Command give you a lot of advantage.

The Net user command is a powerful, built-in utility in Windows that enables an administrator to operate user accounts directly in Command Prompt. It belongs to the larger net command suite – a set of networking and system administration commands that are available on Windows 10, Windows 11 and even older versions.

Consider it to be the command-line version of the User Accounts control panel. With the help of net user, it is possible to create new accounts, modify the user settings, view and delete accounts within one command. Indicatively, when you lose the graphical interface or require creation of users in bulk then the net user command can be used to automate and save time and clicks.

Always run the Command Prompt as Administrator in performing account operations, since changing accounts requires elevated rights.

In this article, we will explore the full guide on how to use Net User Command; its purposes and other relevant information you will need about the Net User Command.

What is the net user command used for?

Net user command is applied to add, edit, or remove local user accounts, and display critical details about user accounts on a computer or domain. For example, simply typing:

net user

will display a list of all user accounts on the local machine. If you specify a username, such as:

net user tommyh

The command will provide details of the user tommyh, such as the complete name, group memberships, account status, password policies, and last time he logged in. Net user is also used by administrators to allow and deny accounts, change passwords and settings.

You may also attack domain accounts through the addition of the /domain switch (such as net user Bob /domain would check with the domain controller about the user Bob). To sum up, net user is a fast method of managing user accounts without the need of using any graphical tools either on a stand-alone PC or in a Windows domain.

Also Read – Detailed Guide on How to Modify the Time Zone in Windows 11

What is the net command in cmd?

The net is a general-purpose system administration and network administration command-line tool in Windows. It is a parent command which contains quite a number of sub command (user, use, group, local group, share etc) and lets you control virtually every part of networking and accounts.

You may as an illustration administer network shares (net share), services (net start/stop), or user accounts (net user), through a single interface. To see the list of available net subcommands, one can type:

net help

or

net /?

This will command all the net commands deployed on your system. You can then run such a statement as net user /? or net help user to obtain detailed usage information of the user management command.

Net in a nutshell, is your all-in-one command when it comes to numerous administrative duties. The net command has not changed significantly on the modern Windows systems (10, 11). Windows 2000 (Now you can forget about net1 or 2 as used in older versions).

Keep in mind that net user is only a single component of this toolkit, and its attention was devoted to the management of user accounts.

How to use net user command to change a password?

Changing a user’s password with net user is straightforward. Use the syntax:

net user <username> <newpassword>

For example:

net user JohnDoe P@ssw0rd123

This gets the account JohnDoe password set to P@ssw0rd123, which immediately changes the logon password of the user. To modify a password of any user, you need to run the Command Prompt as Administrator; otherwise, you will receive the error of Access is denied.

To ensure a higher level of security, you may conceal the password on the screen by typing an asterisk in place of typing the password. For example:

net user JohnDoe *

Will ask you to enter and verify a new password, which will not be echoed on the screen. This will eliminate shoulder-surfing or unintended password leaks.

In case you do not recall the specific username, you can initially use the net user command to give all the accounts. After getting the right account name, repeat the command and change its password.

You can also use net user [username] /domain on a domain controller to change the password of a domain user in an enterprise. Net user is an overall good command-line tool of the type used to reset passwords and manage account credentials.

Read Also – What is SSID Network? How to Find & Protect Yours

How to use net use in Command Prompt?

The net use command, while not part of net user, is another useful net command and is often discussed together with net user. Net use is employed in connection and management of shared network resources (such as mapped drives and shared printers). As an example, you may use: to map a network share to a drive letter:

net use Z: ServerName ShareName

The shared folder is linked to drive Z: on your local computer as follows: Credentialing may also be provided where necessary, such as:

Net use Z: ServerName ShareName /user:DOMAIN/JohnDoe P@ssw0rd

To identify an alternative user name and password.

To get a list of connections to the network on your system, open run net use and your system will list all the connections to the network. As an example, in case you have mapped drives, they will appear. To unmount a mapped drive, execute:

net use Z: /delete

This removes the Z: mapping. The /persistent flag is used to save the mapping to be used in subsequent logins. An example would be net use Z: \\servername sharename /persistent:yes to have the mapping of the Z: persist through a reboot. To stop being persistent, say /persistent:no.

Briefly, take care of network connections with net use: map/unmap drives, see what is already mapped, and regulate persistence. It is used to complement net user by dealing with shared resources.

To see the entire documentation of net use, refer to the Microsoft documentation of net use. Similar to net user, it usually needs a high (Administrator) Command prompt to change settings.

How to Use Net User Command

The net user command is capable of doing numerous things. The following are some of the common examples and tips:

  • List all user accounts:
  • net user

This displays every user account on the local PC. It’s a quick check of existing users.

  • View account details:
  • net user [username]

By inserting a real account name instead of [username], the settings of the account (last password changed date, time spent on the computer, the membership of this or that group, and so on) will appear.

  • Create a new user:
  • net user NewUser Secret123 /add

This creates an account of NewUser with password Secret123. The account is enabled with a password by default. You may add additional options, such as:

NewUser Secret123 /add /fullname:Alice Smith /passwordreq:yes /active:yes.

This sets the complete name, begins the password and allows the account (but /active:yes defaults).

  • Delete a user:
  • net user OldUser /delete

This removes the OldUser account from the system.

  • Change password requirements:
    You can require or disallow a password. For example:
  • net user JohnDoe /passwordreq:no

Makes the JohnDoe account not require a password (not recommended for secure environments). By default, Windows requires passwords (unless changed).

  • Set logon hours:
    You can restrict when an account may log in. For example:
  • net user jays Cyk4^g3B /add /passwordreq:yes /times:M-F,8AM-5PM /fullname:”Jay Jamison”

This (as in the case of Microsoft) makes the user jays (whole name Jay Jamison, have a password and can only be logged in between Monday and Friday, 8 AM to 5 PM. In this case /times:M-F,8AM-5PM translates to Monday and Friday, 8:00-17:00. Other days/time can be specified like these.

  • Enable or disable an account:
  • net user JohnDoe /active:no

Disables the JohnDoe account so it cannot log in. Use /active:yes to re-enable it.

  • Modify other properties:
    You can set comments, expiration, profile paths, etc. For example, /expires: never makes an account never expire, and /fullname:”Name” sets the full display name.
  • Using in scripts:
    Because net user is a command-line tool, you can use it in batch scripts or automation. For instance, redirect output:
  • net user > C:\Logs\user_accounts.txt

will save the list of accounts to a file.

You can also chain commands or can be used with task automation.

Do not forget to execute such commands as an administrator. In case of need, view net user /? or official documentation to view complete syntax and all options. You can manage Windows user accounts wholly using the command line using these commands.

Also Read – How to Block Websites on Google Chrome For Better Safety & Productivity

FAQs

How to use net user command to change a password?

To change a password with the net user command, open Command Prompt as an administrator, and use either net user USERNAME NEWPASSWORD to set the password directly, or net user USERNAME *

How to unlock a password using cmd?

To enable the Administrator account, follow these steps:
Start your computer to Safe mode with networking support.
Log on as the administrator.
Click Start, click Run, type cmd, and then press Enter.
At the command prompt, type the following command, and then press Enter: net user administrator /active:yes.

How to Reset the Administrator Password Using CMD?

This can be done by pressing [Windows] + [R] at the same time

Conclusion

Finally, a net user command cannot be ignored as a useful tool in the administration of the Windows system. Hard-coding sensitive passwords into scripts should be avoided as a best practice; the passwords should be typed using the prompt of stars to type passwords in a secure way. To avoid unintentional lockout, always check usernames and parameters.

Do not forget that in the enterprise environment, the execution of these commands may be run with /domain and privileged conditions. Any modification you make would be recorded in the security logs of Windows, be careful.

Knowing how to use it will save time, as well as it will give accurate control on user accounts. No matter what you are doing be it resetting a password, creating a lab of new users or you are setting up users in bulk, net user can do the work with a couple of keystrokes.

References

Recommendations

Bright Emeka
Bright Emeka
Articles: 332