Windows change user password command line

Learn how to change user password for local or domain accounts from command prompt using net user command.

on September 11, 2011

We can change a user password from Windows command line using net user command. The command is explained below with examples.

How to change local user password

net user  loginid  newpassword

For example, if you want to reset the password for the user John on the local computer, you can run the below command. Let’s say the new password is pq12d*[email protected]

net user  John  pq12d*[email protected]

You may not want to provide the new password in the command prompt for obvious security reasons. Net use command allows to reset the password so that none around your desk can see it. You need to provide * in the place of password while executing net use command. You will be prompted to type the password and the password you enter won’t be printed on the screen. But you need to feed the password twice to make sure that you have entered the password you intended to.

example:

C>net user John *
Type a password for the user:
Retype the password to confirm:
The command completed successfully.

How to change domain user account password

If you want to change password for a domain account, you can do it by running the below command.

net  user  loginid  *  /domain

Next, you will be prompted twice to enter the password and on successful completion your domain account password will be reset. You can also provide the password in the command itself as explained above.

In case the domain is not reachable then you will get the below error when you try to run the above command.

System error 1355 has occurred.
The specified domain either does not exist or could not be contacted.

Related Posts:

  • Add new user account
  • Enable or disable user account
  1. Image titled Change a Computer Password Using Command Prompt Step 1

    1

    Open your PC’s Start menu. You can do this either by clicking the Windows logo in the bottom-left corner of the screen, or by pressing the Win key on your keyboard. The Start menu will open with your mouse cursor in the «Search» field.

  2. Image titled Change a Computer Password Using Command Prompt Step 2

    2

    Type command prompt into the «Search» field. This will search your computer for the Command Prompt app. You should see it pop up at the top of the search menu.

    • On Windows 8, you can bring up the «Search» bar by hovering your mouse in the top-right corner of the screen and clicking the magnifying glass when it appears.
    • If you’re using Windows XP, you’ll instead click the Run app on the right side of the Start menu.

    Advertisement

  3. Image titled Change a Computer Password Using Command Prompt Step 3

    3

    Right-click Command Prompt. It resembles a black box; right-clicking it will invoke a drop-down menu.

    • If you’re using Windows XP, you’ll instead type cmd into the Run window.
  4. Image titled Change a Computer Password Using Command Prompt Step 4

    4

    Click Run as administrator. It’s near the top of the drop-down menu. Doing so will open Command Prompt with administrator privileges.

    • You’ll need to confirm this choice by clicking Yes when prompted.
    • If you’re using Windows XP, you’ll click OK to open Command Prompt.
  5. Advertisement

  1. Image titled Change a Computer Password Using Command Prompt Step 5

    1

    Type net user into Command Prompt. Make sure you include the space between the two words.

  2. Image titled Change a Computer Password Using Command Prompt Step 6

    2

    Press Enter. Doing so will display a list of all user accounts registered to your computer.

  3. Image titled Change a Computer Password Using Command Prompt Step 7

    3

    Find the name of the account you wish to edit. If you’re changing your own account password, it will be below the «Administrator» heading on the left side of the Command Prompt window; otherwise, the name will likely be beneath the «Guest» heading on the right.

  4. Image titled Change a Computer Password Using Command Prompt Step 8

    4

    Type net user [name] * into Command Prompt. You’ll replace [name] with the name of the account for which you wish to change the password.

    • When you type in the account name, you must do so exactly as it appears in the account name section of Command Prompt.
  5. Image titled Change a Computer Password Using Command Prompt Step 9

    5

    Press Enter. This will run your command; you should see a new line appear with «Type a password for the user:» written.

    • If you instead see a group of lines that start with «The syntax of this command is:», type net user Administrator * in for an administrator account or net user Guest * for a guest account.
  6. Image titled Change a Computer Password Using Command Prompt Step 10

    6

    Type in a new password. The cursor won’t move while you do this, so be careful not to accidentally press the Caps Lock key.

  7. Image titled Change a Computer Password Using Command Prompt Step 11

    7

    Press Enter. You’ll be prompted to re-enter your password.

  8. Image titled Change a Computer Password Using Command Prompt Step 12

    8

    Re-type your password. Again, it won’t appear as you type, so take your time.

  9. Image titled Change a Computer Password Using Command Prompt Step 13

    9

    Press Enter. As long as the two word entries match each other, you’ll see «The command completed successfully» display beneath the second password entry. The next time you attempt to log onto your PC, you’ll need to enter your updated password to continue.

  10. Advertisement

Add New Question

  • Question

    How do I remove a password using cmd?

    Community Answer

    Follow the steps listed above and when it prompts you to put in the password just press enter twice.

  • Question

    Will this work on Windows 8?

    Community Answer

    Yes, this will work in Windows 8 or Windows 8.1. With any Admin account, after right clicking the Start screen box in the bottom left corner(for Windows 8.1) (or by clicking the very left corner) and clicking Command Prompt (Admin), you can achieve the same box — just agree to the User Account Control box by clicking the OK button from the dialog box. Otherwise, stay with the same process from that point forward.

  • Question

    I bought a computer from someone and now I can’t reach him. There are two administrator passwords. How can I remove the administrators and passwords on what is now my computer?

    Community Answer

    If you’re on Windows 8/10, press and hold Shift key while you’re clicking on Restart in Power Options. It will show a Recovery menu. There press advanced, command prompt, and wait. You need to type the same commands listed in the guide. Basically this is an admin command prompt, so you should have the privilege to change the admin password.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • If you do not have an administrative account, you likely won’t be able to use Command Prompt at all.

  • If you don’t have admin access, you can enter in recovery mode, there is an admin command line.

  • If you turn off the power without shutting down, enter the startup recovery and then quit half way through it will give you an error report, there is a link at the bottom to a text file, it opens in notepad. That gives you access to the file menu. From there you can rename the command prompt to sticky keys. Upon login shift five times now loads command prompt as administrator instead of sticky keys. Now you can reset your admin account if you’re locked out.

Thanks for submitting a tip for review!

Advertisement

  • Never change the password on a computer for which you don’t have permission to do so.

Advertisement

About This Article

Thanks to all authors for creating a page that has been read 1,817,640 times.

Is this article up to date?

Here’s how to use the «net user» command line option to quickly change a password in Windows.

Command line interface with cartoon people sitting around it working on laptops

Need to change a user password in Windows 10 or 11? You can do this through the Settings app, but it’s much faster and takes fewer clicks to change a password through the command line instead.

Even if you’re new to text commands on Windows, changing the user password with the net user command is simple. We’ll show you how to change a Windows password using the command line with this handy method.

Use the Net User Command to Change a Windows Password

To change another Windows user’s password via the command line, you need administrator privileges. See how to get admin rights on Windows if you aren’t using an admin account already.

Also, keep in mind that this method only works for local accounts in Windows 10 and 11. It won’t work if you use a Microsoft account to sign in to Windows; you’ll need to change the password using Microsoft’s web account management page instead. See our guide to securing your Microsoft account for help with this and other security measures.

Now, here’s how to change passwords via CMD using net user:

  1. Open an administrator Command Prompt window. To do this, type cmd into the Start menu, then right-click on the Command Prompt entry and choose Run as administrator.
    1. You can also use PowerShell or the Windows Terminal to perform this; you’ll find a shortcut to those by right-clicking the Start button or hitting Win + X.
  2. Type the following net user command and press Enter to list all the users on your system. When they appear, take note of the account name you want to change the password for:
     net user 
  3. To change a password, type the net user command shown below, replacing USERNAME and NEWPASS with the actual username and new password for the account. If the username is more than one word, you’ll need to place it inside quotes, as shown:
     net user USERNAME NEWPASS 
     net user "USER NAME" NEWPASS 
  4. After you press Enter to run this command, you’ll see a message that it completed successfully. Now you can use the new password to log into this account, just like if you had changed it via the graphical interface.

Windows 10 Change Password Net User

If you see an Access denied message when you try this, make sure that you started the Command Prompt (or other command line window) as an Administrator. Standard users can’t change the password for other accounts. If you see an error that the username wasn’t found, make sure you typed it correctly.

How to Privately Change a Password With Net User

You might want to prevent people around you from seeing the new password that you type when using net user. Thus, for more privacy, you can use a slightly different command to prevent the new password from appearing in plain text onscreen.

To do this, follow the above instructions, but type the following instead for step 3, replacing USERNAME with the actual username:

 net user USERNAME *  

Windows will then ask you to type a new password twice. However, the passwords don’t appear as you type, making sure anybody nearby won’t see them.

If you’ve lost your administrator password, follow our tips for resetting a lost Windows admin password.

Change Your Windows Password More Conveniently

Now you know how to use the net user command to change passwords in Windows. It’s a quick way to change passwords without sorting through menus, plus you can change multiple passwords in quick succession without your hands leaving the keyboard.

Give it a try next time you need to change a user password. And when you set a new one, make sure to choose a strong password that’s not easy to guess or crack.

Home » Windows 10 » Change Windows 10 Password Using Command Prompt

If you feel that the Login Password for your computer has been compromised, you will find below the steps to Change Windows 10 Password using Command Prompt and Settings.

Change Windows 10 Password Using Command Prompt

Depending on how the computer was initially setup or due to your own preference, you might be using either Local or Microsoft Account to login to your computer.

If you are using a Local Account, you can change the Login Password for your computer using Command Prompt and also by using Settings.

If you are using Microsoft Account to login to your computer, you can refer this guide: How to Change Microsoft User Account Password in Windows 10.

1. Change Windows Password Using Command Prompt (CMD)

If you prefer using Command Prompt, you can follow the steps below to change the login password on your computer.

Click on Start button and type Command Prompt in the Search bar. Right-click on Command Prompt in the search results and click on Run as Administrator option.

Open Command Prompt As Admin

In Command Prompt window, type net user Username NewPassword and press the Enter key.

Change Windows Password Using Command Prompt

Note: In above Command, replace Username with your actual User Name and NewPass with the New Password that you want to use.

Once this Command is successfully executed, you will be able to login to your computer using New Password.

Tip: If you do not know the Name of your User Account, type net user in Command Prompt window and press the Enter key. This will list the Names of all User Accounts on your computer.

2. Another Way to Change Windows Password Using Command Prompt

Open Command Prompt, type net user Username * > press Enter key > Type New Password and Retype the New Password to confirm.

Change Windows Password Using Net User Command

Note: In above command, replace Username with your actual User Name (Family in this case).

Once you Retype your New Password and press the Enter Key, the Login Password on your computer will be changed and replaced with the New Password.

The only problem with above Command is that you won’t be able to see anything when you Type and Retype your New Password.

3. Change Windows Login Password Using Settings

The simplest way to change the Login Password in Windows 10 is by going to Settings.

Go to Settings > Accounts > select Sign-in Options in the left pane. In the right pane, scroll down and select the Password option and click on the Change button.

Change Password Option in Windows

On Change your Password Screen, enter you Current Password and click on the Next button.

Confirm Current Password in Windows 10

On the next screen, enter your New Password, Reenter Password and click on the Next button.

Change Your Password Screen in Windows 10

Finally, click on the Finish button.

Finish Change Password Process in Windows 10

Now, you can login to your computer using the New Password.

  • How to Delete User Account In Windows 10
  • How to Disable User Accounts in Windows 10

On Windows 10, if you suspect your password has been compromised, it’s a weak password, or if you have been using the same password for a long time, it is a good practice to change your Windows 10 account password to something different and difficult for someone else to guess.

If you have a local account without a Microsoft account, there are multiple ways to change your password, but one quick way is to use Command Prompt.

In this guide, you will learn the steps to change your local account password on Windows 10.

To change your local account password with Command Prompt, use these steps:

  1. Open Start on Windows 10.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to view all the available accounts and press Enter:

    net user
  4. Type the following command to change the account password and press Enter:

    net user USERNAME *

    In the command, make sure to change USERNAME with the account name you want to update.

    Command Prompt change account password

    Command Prompt change account password
  5. Type a new password and press Enter.

  6. Type the new password again to confirm and press Enter.

Once you complete the steps, sign out and sign back into the Windows 10 account to start using the new password.

The steps outlined above won’t apply if you have an account linked to your Microsoft account. In this case, you need to follow these steps to change your account password.

Although this guide focuses on Windows 10, these steps should also work on Windows 8.1 and Windows 7.

We may earn commission for purchases using our links to help keep offering the free content. Privacy policy info.

All content on this site is provided with no warranties, express or implied. Use any information at your own risk. Always backup of your device and files before making any changes. Privacy policy info.

Windows provides the “net user” command in order to manage user account from the command line interface of MS-DOS or PowerShell. The “net user” command generally used to change a user password where the current password will be reset into the specified new one. The “net user” command can be also used to change or reset domain user/active directory user password too.

“net user” Command Syntax

The “net user” command has the following simple syntax.

net user OPTION USERNAME PASSWORD
  • OPTION is used to change or update domain user password. OPTION is optional.
  • USERNAME is the username or login ID we wan to change or update password. USERNAME is required.
  • PASSWORD is the new password which will be set for the specified USERNAME.

The most popular usage of the “net user” command is changing the user password by providing the username and password as a parameter to the “net user” command. In the following example, we will change the password of the user named “ismail” to “..3awCse^+!,,”. Even the username and password can be directly provided to the “net user” command using double quotes to prevent unexpected errors and make more secure execution. Also selecting a secure password is important and secure password selection is described below.

net user "ismail" "..3awCse^+!,,"

This way we can change the current user password from the MS-DOS or PowerShell command line interface. If we want to change another user password than the current user the Administrator privileges are required which can be provided by opening the MS-DOS or PowerShell command line interface with Administrator privielges like below.

Open MS-DOS As Administrator

Type New Password Interactively and Securely

A more secure way to update or set the specified user password is using the interactive way to provide password. If the password is provided as the “net user” command this can be stored in history or logs etc where the password can be readable. By providing the password interactively the password is not displayed on screen of command line. The * sign is used as the password part for the “net user” command which will input password interactively. In order to prevent mistyping password and the password is asked two times for matching them.

net user "ismail" *

The password is typed two times in the following steps.

Type a password for the user: 
Retype the password to confirm: 

If the new password is set successfully the following message is printed as output. If there are errors that prevent the change or update of password different errors can be printed instead of the “The command completed successfully.” message. These errors are described below.

The command completed successfully.

Change Domain User Password

In most cases, the “net user” command is used to change local user passwords. But it also supports change of domain user passwords. In order to change domain user passwords with the “net user” the current system should be a domain computer and has access to the domain controller currently. The syntax and ways are the same to change or update the domain user password where the /domain option should be provided before or after the username and password.

net user /domain "ismail" "..3awCse^+!,,"

Like a local user password change the domain user password can be also changed in an interactive and more secure way. We will provides the * sign for interactive domain user password change. The password is typed two times to prevent errors and match new password.

net user /domain "ismail" *

Selecting Secure Password

Selecting secure password is very important as today. Especially simple or default passwords are actively hacked by attackers and creates big securtity problems. First of all change default passwords into different ones with a secure password. A secure password should meet some requirements like below.

  • Use 14 characters at least.
  • Use Uppercase letters.
  • Use lowercase letters.
  • Use numbers.
  • Use special characters like !,+%; etc.
  • Do not use common character sequences like 123456,abc etc.

“net user” Related Errors

While using the “net user” command some errors may occur. Below we will list some errors about the “net user” commands.

While changing the domain user password the system should access the domain controller via the network. If the domain controller is not accessible this will prevent the update or change of the domain user password and print “System error 1355 has occurred.” error like below.

System error 1355 has occurred. 
The specified domain either does not exist or could not be contacted.

While changing the local user password the current user password can changed without any privileges requirement because he is changing his own password. But if another user password is changed the current user should has Administrator privileges. If not the MS-DOS or PowerShell command line interface should be opened as Administrator. If non of these are complied the “Access Denied” error is retuned by the “net user” command.

The Solution which Breakthrough gave is useless if you have a limited account.Here’s what you to get admin privileges :-

Step One:
First, open Command Prompt
(either; Start->Run->Type cmd.exe->OK OR; Double-Click C:WindowsSystem32cmd.exe

Step Two:
Create an account, if you do not wish to create a new account, ignore this step.
Type the following into the black box that appears (command prompt)

net user /add

Example:
net user max 123456 /add

This will create a password protected account.
The username will be max
The password will be 123456

Step Three:
Find all of the user groups that are available on the network

net localgroup

This will bring up a list like this
*Administrators
*Debugger Users
*Guests
*HelpServicesGroup
*Users
The command completed successfully. (can be different according to different systems)

Step Four:
Input the following into Command Prompt

net localgroup /add

Example:

net localgroup administrators max /add

This would add the username “max” join the group “administrators” and have all privileges related to that group.

This will work on local machines. and if you are lucky enough and the admin is not very good on what he is doing you can create your own admin account in an networked environment as well :) :) but if the cmd command prompt is restricted or a manual access rights are placed then no way to make this work.. You will probably get into trouble if you get caught doing this.. I have only provided this as an example of what you can do with command prompt and thus why it should always be disabled on limited accounts, I am not responsible for anything you do with this. also note that this only work at home or in an unmanaged network.

Have fun

Changing a windows password using the Net User command in the command prompt is relatively easy. Net user change password feature can help anyone in doing this activity within a few easy steps. In this blog, we’ll be discussing the Net User like how easy it’s to perform necessary action using Net User. Moreover, we’ll be discussing how you can use Net User to change passwords.

Alongside, we’ll take a look at the amazing UnlockGo (Windows) – a tool that can help you unlock all types of windows lock when net user command not working. Moreover, it’ll help you to unlock your locked windows. Follow this blog to know more about it.

Part 1. What Is Net User?

A Net User is a command-line tool or a program that helps admin accounts or system administrators manage user accounts on Windows PCs. Furthermore, you can use this tool to activate all other accounts on your Windows PC. When you type in the Net User command on the command prompt, you’ll get a list of accounts on your PC. You can choose one to deactivate or activate.

Part 2. Net User Change Password Command Line Windows 11/10/8/7

Here is how you can perform net user reset password on windows 11/10/8/7 seperately in command prompt:

2.1 Windows 11 and Windows 10

  • Open Start on Windows 11/10.
  • Type on Command Prompt in the search bar, right-click on it, and choose the Run as administrator option.
  • Enter the “net user” command into the command prompt to check the entire list of entire accounts, and then press the Enter Key.
  • Type the “net user USERNAME *” and press the Enter key to continue. You must note that the USERNAME should be the account’s name to be unlocked.
  • net user change password

  • Type a new password and press the Enter key.
  • Re-enter the password and confirm by pressing the Enter key.

2.2 Windows 7 and Windows 8

Tips: Net User Command Change Password Access Denied Alternative Way

If you’re willing to change forgotten Windows 11, 10, 8, or 7 passwords without the Net User command, then iToolab UnlockGo (Windows) is the best tool to install. The tool can help you unlock your locked PC without requiring any technical knowledge to use it. The tool allows you to remove or change windows passwords by performing the following easy steps:

Step 1. Firstly, install UnlockGo for Windows on an accessible computer, then click “Start”. And then insert a blank and bootable USB/CD/DVD into it to make a windows password reset disk.

insert usb unlockgo windows

Step 2. Once done please follow the on-screen instructions to enter boot menu on your locked computer. And then set the bootable device by selecting boot tab and boot device priority using arrow key. Finally press F10 to save and exit.

click next button unlockgo windows

Step 3. Once you’ve exited boot menu, your locked device will reboot and UnlockGo (Windows) icon shows up, you can choose your Windows system and target account to change password with new password.

reset windows password unlockgo windows

Finally, you can restart it and use new password to enter Windows account. It’s much easier with 100% working without data loss.

Summary

Net User Change admin password allows you to change the password of a locked windows account. The Net User tool will enable you to enter a specific parameter in the command prompt to change passwords easily. In this blog, we’ve defined the basic concept of Net User and how you can use this tool on different Windows operating system versions, including Windows 7, Windows 8, and Windows 10. If you’ve not received a solution to your locked Windows PC problem, then you can go for UnlockGo for Windows. The tool allows you to unlock your Windows PC within a few easy steps.

UnlockGo (Windows)

  • Change Windows Password in 3 Steps Using This Tool.
  • Change Password by Creating A Password Reset Disk.
  • It Serves for Windows 11/10/8.1/8/7/Vista/XP(32/64 bit) & Windows Server.

Home

>

Windows Password
>

Net User Change Password Windows 11/10 and Alternative Way

The Net User command is a Windows command-line utility that allows you to manage Windows server local user accounts or on a remote computer.

The command Net User allow you to create, delete, enable, or disable users on the system and set passwords for the net user accounts.

Windows administrators can perform add or modifications in domain user accounts using the net user command-line tool.

You can get net user account information, enable or disable a user account, sets the home directory path, set account expiration, and so on.

net user to display user account info
Command Net User to display user account info

In this article, we will discuss how to use the net user command-line tool with examples to get user account information, domain account status, and password expiry date.

Net User Command – Syntax

net user command syntax

net user [<UserName> {<Password> | *} [<Options>]] [/domain]
net user [<UserName> {<Password> | *} /add [<Options>] [/domain]]
net user [<UserName> [/delete] [/domain]]

Parameters

Username – It specifies user account name to add or modify or display user account information

Password – Assign or change the password for the user account

/domain – Perform the operation on the domain controller

/active:{no |yes} – Enable or disable user account

/comment – Provide descriptive comments for the user account

/expires – Specify the date to expire user account

net help – Display help for the net user command.

<Options> – Specify command-line options.

Refer to the following table to know more about options used in net user command.

Command-line option syntax Description
/active:{no | yes} Use this option to enable or disable a user account. The default value is yes (active).
/comment:”<Text>” Use this to provide comments for the user account, max 48 characters, and should be enclosed in quotation marks.
/countrycode:<NNN> /countrycode option is used to set the country code for the user account to display help or error messages in their language. The default value is 0, which means the computer’s default country/region code.
/expires:{{<MM/DD/YYYY> | <DD/MM/YYYY> | <mmm,dd,YYYY>} | never} Use this option to specify the date for the user account to expire. If the expiration date is not specified, it will assume never expires.
/fullname:”<Name>” Specify the user’s full name instead of username.
/homedir:<Path> Use this option to set the path for the user’s home directory.
/passwordchg:{yes | no} Use this to specify if the user can change their own password. The default value is yes.
/passwordreq:{yes | no} It specifies if the user must have a password or not. The default is yes.
/profilepath:[<Path>] Use this option to sets a path for the user’s logon profile. This path points to a registry profile.
/scriptpath:<Path> Use this to set a path for the user’s logon script. <Path> should be relative.
/times:{<Day>[<-Day>][,<Day>[-<Day>]],<Time>[-<Time>][,<Time>[-<Time>]][;] | all} It specifies the times that users are allowed to use the computer.
/usercomment:”<Text>” It specifies that an administrator can add or change the “User comment” for the account.
/workstations:{<ComputerName>[,…] | *} It lists as many as eight workstations from which a user can log on to the network.
net user command options

Net User – List all User Accounts

Use the Net User command and run it on the Windows command prompt without any parameter to list all user accounts on the local user account.

Open a command prompt to run the net user command below

net user

The above Windows net user command returns the list of all user accounts of the local computer.

net user accounts on local computer
net user accounts on local computer

Run the command net user on the domain controller to get a list of all users on the domain.

net user

The output of the above command net user gets the domain username accounts.

net user domain username
net user domain username

You can also use the net user command-line tool to get user account information, modify a user account, and check when the password was last set.

Net User Account – Display User Account Information

Run the net user command in the command line to get user account information.

net user Toms

The above net user command uses the username to retrieve user details and display net user account information below


C:>net user Toms
User name                    Toms
Full Name                    John Paul
Comment                      Built-in account for administering the computer/domain
User's comment
Country/region code          000 (System Default)
Account active               Yes
Account expires              Never

Password last set            7/29/2021 6:55:50 PM
Password expires             9/9/2021 6:55:50 PM
Password changeable          7/30/2021 6:55:50 PM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   8/2/2021 11:53:32 AM

Logon hours allowed          All

Local Group Memberships      *Administrators
Global Group memberships     *Domain Admins        *Group Policy Creator
                             *Schema Admins        *Domain Users
                             *Enterprise Admins
The command completed successfully.


C:>
net user account details
net user account details

Cool Tip: How to get-aduser in the active directory using PowerShell!

Net User Password Change for User Account

If you want to change a user password using the command line, use the net user command-line tool to set the password.

The syntax for the command net user to set a password for a user account is given below:

net user userid password

Let’s consider an example to reset the password for user account GaryW on the local computer, run the below command

net user garyw [email protected]

In the above net user command, garyw is a user account id and [email protected] is a password that is used with the command to set the password for the user account on the local computer.

The output of the above command as below

net user password change
net user password change

Note: Run Windows command prompt using administrator account privileges else it will display “System error 5 has occurred. Access is denied

There is an alternative and secure way to change the user password using the net user cmd tool as below

C:>net user garyw *
Type a password for the user:
Retype the password to confirm:
The command completed successfully.

In the command, use * after the user name and hit enter.

It will prompt you to type the password for the user: and retype the password to confirm.

While typing a password, it won’t display password text on the command line.

Cool Tip: How to get-aduser password expiration date in PowerShell!

Net User /domain – change domain user account password

Using the net user Windows command-line tool, you can set the password for the domain user account.

The syntax for the command net user to set the password for the domain user account is:

net user username /domain

Run the following command to reset the domain user account password

net user garyw  * /domain

In the above command, the net user command takes the user id as input, * indicates to prompt for the password. /domain specifies to perform domain account password change operation.

The output of the above net user /domain password change as below

net user /domain password change
net user /domain password change

Cool Tip: How to use the Get-AdUser cmdlet to manage Active Directory Use Account!

Net User Disable Account

If you want to disable or lock a domain account using the net user command-line tool, run the following command

net user garyw /Active:No /domain

The above net user command will disable the user account or lock the domain user account specified using the user name and /Active set to No in the net user /domain

Run the command net user garyw /domain to check the user active account status

C:>net user garyw /domain
User name                    garyw
Full Name                    Gary Willy
Comment
User's comment
Country/region code          000 (System Default)
Account active               No
Account expires              Never

Cool Tip: How to find a disabled aduser using PowerShell!

Net User to Enable Domain Account

To enable or unlock domain account using the net user command, run the below command

net user garyw /Active:Yes /domain

net user /domain command using /Active option set to Yes enables user account.

Net User User Password Policy

If you want users to restrict them to change their domain account password or allow domain account user to change their password, run the below net user command

net user garyw /Passwordchg:No

In the above net user command, /Passwordchg option is set to No to prevent the user from changing the password.

To allow users to change the password, run the below command

net user garyw /Passwordchg:Yes

Above command, /Passwordchg option is set to Yes to allow the user to change their password.

Cool Tip: How to find active directory groups I m in using PowerShell!

Net User to find user full name

You can use the net user command-line tool to find the user’s full name in the domain as below

net user garyw /domain | Find /i "full name"

The above command finds the full name of the user in the domain, it uses the username /domain to find the user account in the domain and pipe the result to get the full name.

C:Windowssystem32>net user garyw /domain | Find /i "full name"
Full Name                    Gary Willy

How to set home directory for user?

Use the net user command-line tool to set a home directory for a new user or existing user using the homedir option as below

Set home directory for the new user

net user adams /domain /add /homedir:C:usersadams

In the above command, the net user creates a new user with the name adams in the domain and set up the home directory for the user to C:usersadams

You can set up a home directory for the existing user as below

net user garyw /domain /homedir:C:usersgaryw

In the above command, it set up the home directory for the existing user in the domain using the net user command and homdir option.

Cool Tip: How to unlock the ad account in the active directory using PowerShell!

Set Expiry date for User Account on Local and Domain

The expiration date for the user account has been good practice for organizations to manage security and resource management.

Using the net user command, you can easily set an expiry date for the user account on the local computer or domain user account.

If you want to set up an expiry date for user accounts on the local computer or a windows 11 user account, run the following command.

# Set expire date for local user account
Net User devadmin /expires:03/05/2023

In the above command, the net user command takes the username as the input parameter and uses /expires option to set up the expiry date for the user account on the local computer.

If you want to set up an expiry date for the user account on the domain controller, run the following command.

# Set expire date for domain user account
Net User Toms /domain /expires:09/20/2022

In the above command, the net user takes the user name and uses /domain to set up an expiry date in the domain using /expires option.

Set up Login Times for User Account

Using the net user command, you can set up login times for the user account to allow them to be used within specific hours only.

Run the following command to set login times for the user account.

# Set login time to allow user login in specific duration
Net User Toms /time:M-F,07:00-16:00

In the above command, the net user command takes the user name to set up login time for the account to allow login between 7 am to 4 pm on Monday-Friday only.

Net User Command Examples and FAQ

How to reset the user password using the net user command?

Open the Windows command prompt with Administrator privileges and run the following command to reset the password for a user account.

net user userid newpassword

How to use the net user command?

The net user is a command-line tool to manage user accounts on local and domain controllers. To use the net user command, open the command prompt and type the net user command, it will list all user accounts.

net user

How to check domain user details in cmd?

Use the net user command to view the user account details on the domain. The syntax to check user account information is:

net user userid

How to use the net user command to see when the password expires?

If you run net user userid on cmd terminal, it retrieves user information that includes the property “Password expires“. Use this property to see the user account password expiry date.

How to use the net user command to check the last login of the user?

To check the last login of the user on the domain using the net user command, run the command prompt and run the below command.

net user Toms /domain | Findstr "Last"
It returns the Last Login date for the user account on the domain.

How to use the net user command to set a password never expires using the command line?

To set the password never expires on the user account using the net user command in the cmd terminal, run the following command.

WMIC useraccount where Name='username' set PasswordExpires=FALSE

For example, to set the administrator password never expires using the net user command,

net user administrator |findstr /C:expires
Returns the output as
Account expires Never
Password expires 2/26/2023 4:10:20 PM

Run the WMIC command to set the PasswordExpires property for the administrator account to false.

WMIC useraccount where Name='administrator' SET PasswordExpires=FALSE

The above command line tool, set up the administrator password never set to expire.

Conclusion

I hope the above article on the net user command line tool in the Windows system helps you to understand how to manage net user accounts using the command line.

net user without any option gets all the user accounts on the computer. You can also use net users.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.

Like this post? Please share to your friends:
  • Windows boot manager пропал в bios uefi
  • Windows boot manager boot bcd windows failed to start
  • Windows change network type from public to private
  • Windows boot manager при включении компьютера
  • Windows change language on caps lock