“net user” Command Tutorial

Lifewire / Derek Abella 

Windows operating systems provide the net user command in order to manage user and user account-related configurations via the command-line interface. The “net user” command provides practical usage without the need for the GUI. As the “net user” command is related to user management it may sometimes require Administrative privileges.

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.

How many times have you forgotten a password in the last year? Losing a website password isn’t a huge deal, because you can reset those with your email address. But forgetting your computer password is scary, because they’re more difficult to reset.

Protecting your computer with a strong, unique password remains incredibly important. You can protect your smartphone or laptop with a fingerprint, iris, and other biometric scanners. However, a strong single-use password is a vital layer of protection.

But what happens if you forget your Windows XP password? Are you locked out of your Windows XP account for good?

September 11, 2011

How to change local user password

net user  loginid  newpassword
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.

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.

March 29, 2011

Net user /add username  newuserPassword /domain
Net user /add username  newuserPassword
Net user username  /ACTIVE:NO /domain
Net user loginid /ACTIVE:YES  /domain
Net user username  /Passwordchg:No
Net user username  /Passwordchg:Yes
Net user username
C:\>net user techblogger
User name                    techblogger
Full Name
Comment
User's comment
Country code                 000 (System Default)
Account active               Yes
Account expires              Never

Password last set            4/21/2011 10:10 PM
Password expires             8/19/2011 10:10 PM
Password changeable          4/21/2011 10:10 PM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   Never

Logon hours allowed          All

Local Group Memberships      *Users
Global Group memberships     *None
The command completed successfully.
net user username password /ADD
net user John fadf24as /ADD
C:\>net user /add John *
Type a password for the user: 
Retype the password to confirm:
The command completed successfully.
C:\>

To add a new user account to the domain:

net user username password /ADD /DOMAIN

Note that the command does not include the name of the domain, it automatically adds to the domain the computer belongs to.

net user John fadf24as /ADD /DOMAIN

Rename a user account

Few more advanced uses of net user command.

net user username password /ADD /FULLNAME:"User_Fullname"
net user username password /ADD /PASSWORDCHG:Yes
net user username userpasswd /ADD /PASSWORDCHG:NO

To set account expiry time we can use /EXPIRES switch. This can also be used to set that the account never expires.

Errors:

  1. If you don’t have privileges to add new user account to the system, you would get an error like below.
    C:\>net user John /add
    System error 5 has occurred.
    Access is denied.
    C:\>
  2. While adding user to domain, make sure that your computer is connected to the domain. Otherwise it throws up below error.
    C:\>net user testuser testpassword /ADD /DOMAIN
    The request will be processed at a domain controller for domain mydomain.com.
    System error 1355 has occurred.
    The specified domain either does not exist or could not be contacted.

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.

1. Change Windows Password Using Command Prompt (CMD)

Open Command Prompt As Admin

Change Windows Password Using Command Prompt

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

2. Another Way to Change Windows Password Using Command Prompt

Change Windows Password Using Net User Command

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 > > select in the left pane. In the right pane, scroll down and select the option and click on the  button.

Change Password Option in Windows

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

Confirm Current Password in Windows 10

On the next screen, enter your , and click on the button.

Change Your Password Screen in Windows 10

Finally, click on the button.

Finish Change Password Process in Windows 10

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

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




Use the Net User Command to Change a Windows Password

:/>  Командная строка. Основные команды | RAYBIN

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.

  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  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

How to Privately Change a Password With Net User

 net user USERNAME *  

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

Change Your Windows Password More Conveniently

Full Format and Reinstallation

If nothing but nothing else works, and you’re still somehow locked out of your account, there is only one more option: fire. Okay, not fire. But you will have to remove your hard drive from its host machine, connect it to another machine to complete a backup, and then format the drive.

Once the format is complete, you can reinstall Windows XP and enter a new password that you can actually remember.

Reset Windows XP Password Using Ctrl+Alt+Del

windows xp login screen admin
  1. When you boot your system, it will load the Welcome Screen. Press Ctrl + Alt + Delete twice to load the user login panel.
  2. Press OK to attempt to log in without a username or password. If that doesn’t work, try typing Administrator into the Username field and pressing OK.
  3. If you’re able to log in, head straight to Control Panel > User Account > Change Account. Then, select the account that you’d like to change the password for, and follow the on-screen instructions.

Reset a Local Windows Admin Password Using the Lock Screen Workaround

If you don’t use a Microsoft account to log into Windows, you’ll have to reset the password for a local account. Windows 10 and 11 allow you to set security questions for local accounts that help you get back in easily from the lock screen if you forget the password. If you haven’t set those up already, however, they won’t do you much good now.

Setting Up the Password Reset Workaround

First, you’ll need to create a bootable Windows 10 disk on a flash drive. This will obviously require another computer, since you can’t get into yours.

Once you’ve made that, insert the drive into your PC so you can boot from the new installation. On most machines, you need to press F12 or a similar key as soon as you power on your computer to choose a device to boot from.

Boot from your flash drive, let the Windows installer load, and when you see the initial Windows Setup screen, press Shift + F10 to open a Command Prompt.

Windows Setup Screen
  /d C: 

If the command returns The system cannot find the drive specified, then that letter isn’t right; try D and continue down the alphabet. Once you find the right drive, you’ll want to change the directory again using the cd command. Type this line to access the System32 folder:

  Windows\System32 

If you see The system cannot find the path specified, you’ve selected a drive other than the one Windows is on. Change the drive to a different letter and try again until you find the right one.

Once you’re in the System32 folder, you can pull a little trick. Windows includes an accessibility feature called Sticky Keys, which you can launch by hitting the Shift key five times quickly. By swapping the executable that runs Sticky Keys with a link to the Command Prompt’s executable file, you can run a command line to reset your password right from the login screen.

To do this, type these two commands, one at a time. The first backs up the Sticky Keys shortcut in the C:\Windows folder (the .. is a shortcut to move to the parent folder) so you can restore it later; the second replaces the Sticky Keys shortcut with a Command Prompt shortcut. If asked to give approval for either, do so.

 copy setch.exe ..
copy cmd.exe setch.exe
Windows Setch Copy

You’re done here, so type this command to reboot the computer and head back to the normal sign-in screen:

 wpeutil reboot 

Running a Command Prompt to Change Your Password

On modern versions of Windows 10 or Windows 11, you’ll have to reboot into Safe Mode for this to work. To do this, click the Power menu in the bottom-right corner of the login screen. Then, hold the Shift key and click Restart. If you see a warning that restarting may cause people to lose work, click Restart Anyway.

Windows 10 Startup Settings Safe Mode

Then, reboot into Safe Mode and click the Ease of Access icon at the bottom-right of the login screen, which should hopefully bring up the Command Prompt. On Windows 10, this icon looks like the clock icon in the bottom-right of the image below. On Windows 11, it looks like an outline of a person.

:/>  Где и куда сохраняются скрины, файлы принт скрина на компьютере, ноутбуке? Принтскрин: где хранятся скриншоты экрана на ПК, ноутбуке Windows 7, 8, 10?  . Куда сохраняется, где найти принтскрин
Windows CMD Sign In Screen
 net user username password
net user John newpass123
 net user username password /add
net user Rick greatpass123 /add
 net localgroup Administrators username /add
net localgroup Administrators Rick /add

Now, you’ve changed your account password and can log back in using it. Since you don’t want to work in Safe Mode, reboot your computer and sign back in again as normal.

Putting Sticky Keys Back to Normal

Then use this command to put the Sticky Keys shortcut back. If you used the utilman.exe method, run the same command with that instead of sethc.exe:

 Robocopy C:\Windows C:\Windows\System32 sethc.exe /B 
Windows Copy Setch Back

Robocopy is a more robust copying operation that’s necessary to use since you’re changing a system file here. After you run the command, pressing Shift five times should bring up the Sticky Keys window again, which means you’re back to normal.

So you know, the backup setch file is still located under C:\Windows, but this isn’t hurting anything. Feel free to delete it if you like; just don’t delete the actual file located in the System32 folder.

Change Domain User Account Password

net user USER * /domain
> net user ismail * /domain

List All User Accounts

> net user
“net user” Command Tutorial

Reset the Password by Booting Into a Linux USB

Create a Drive and Boot Into Linux

First, you’ll have to make a bootable Linux USB drive on another computer. It doesn’t matter which flavor of Linux you use; if you’re not sure, Ubuntu and Mint are two beginner-friendly options.

Once you’ve made the USB drive, start up the locked PC and look for the prompt to press F12, ESC, Delete, or similar to choose your boot device. See the linked guide above if you need to change the boot order on your PC.

After choosing to boot from USB, give Linux a moment to start up. Depending on which distro you’ve chosen, you may boot right into a Linux environment, or have to complete some setup tasks like setting the time zone. If asked to install Linux on your computer, don’t do so; click Try or similar to stay in the live environment on your USB drive.

You’ll need to open the OS’s file explorer app. On Ubuntu, this is the folder icon on the left sidebar. If you’re using Mint, there’s a folder icon in the bottom-left corner, like Windows.

Mount Your Windows Drive

With a file explorer window open, press Ctrl + L to edit the Location path and type this to see all your drives:

 computer:/// 

Find the drive that you have Windows installed on. If you only have one hard drive in your computer, it will be the only one present. In the below example, File System is the Linux environment, so VBox Harddisk is the correct Windows drive.

Right-click on your Windows drive and choose Mount so Linux can access it.

Linux Mount Windows Drive

Reset Your Windows Password From Linux

From here, you’re going to work in the Linux Terminal. Don’t worry—it’s not scary, even if you’re new. The shortcut to open the Terminal in Mint and Ubuntu is Ctrl + Alt + T.

First, you need to install a password reset utility called chntpw. Type this command to install it:

 sudo apt-get install chntpw

Next, you need to change the working directory (the cd command stands for change directory) to your Windows folder. To get the right location, go back into the file browser and open your Windows drive. Drill down into the Windows > System32 folder. Now, click inside the address bar at the top of the file browser window and use Ctrl + C to copy the address.

Linux Copy Windows File Location

Back in the Terminal, right-click and Paste the address you copied, placing it after the cd command. You’ll also need to add /config at the end of the address; this folder doesn’t always show in the visual file browser, but adding it manually will work.

All told, the command you run should look like this:

  /media/mint/DA6C861A6C85F215/Windows/System32/config
 sudo chntpw -l SAM
Linux chntpw User List
 sudo chntpw -u  SAM
Chntpw Linux Windows Password

Enter q to exit the chntpw prompt, then y to save your changes. Now you’re done in the Linux environment. In Mint, click the Menu button in the bottom-right to find the power options and shut down; in Ubuntu, the power icon is at the top-right.

Reboot into Windows and you can sign into your account using the blank password. Once inside, you should head to Settings > Accounts > Sign-in options and choose Password to set a new password, as leaving your account with no security isn’t smart.

“net user” Command Syntax

net user USER OPTIONS
  • The USER is the user account name.
  • OPTIONS are single or multiple options with their parameters or values.

Set Home Directory For User Account

> net user ismail /domain /add /homedir:C:\users\ismail

Net User Command Syntax

How to Avoid Losing Your Windows Password in the Future

While none of these password recovery methods are terribly difficult, they are inconvenient. You don’t want to lose your password again in the future and have to rely on them. There are several ways to prevent yourself from having to reset your Windows password down the road.

First, if you don’t already use a Microsoft account to sign into Windows 10 or 11, we recommend doing so. This way, you can easily reset your password via the web interface if you ever forget it.

Even if you don’t use a Microsoft account, setting a PIN on your Windows account gives you another option for signing in that’s easier to remember.

Windows PIN Password Options

We also strongly recommend using a password manager to store all your passwords safely. When using a password manager, you only have to remember a few passwords instead of dozens or hundreds.

Finally, Windows also lets you create a password reset disk to avoid these lengthy workaround methods in the future. Connect a flash drive, then search for password reset disk in the Start menu to launch the Create a password reset disk tool.

Windows Create Password Reset Disk

Walk through the steps to create a reset disk using your flash drive. If you get locked out of your account in the future, you can plug in that drive to regain access. This works no matter how many times you change your password, but keep in mind that anyone who has the drive can use it to access your account. Keep it safe!

“net user” Related Errors

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

Enable User Account

> net user ismail /Active:Yes

Reset Windows XP Password via Another Account

Resetting your Windows XP password via an alternative account only works if you are using Windows XP Professional.

  1. Start by right-clicking My Computer and selecting Manage.
  2. Then, select System Tools > Local Users and Groups > Users. Find your user account, right-click, and select Set Password.
windows xp user account password change options

Reset Windows XP Password via Remote User Management

If you cannot access Computer Management using your own or an alternative account, you can use remote access instead.

:/>  Является ли ваша учетная запись Windows 10 администратором? Вот как узнать

On a different computer (it doesn’t have to be Windows XP, but it does have to be a Windows machine):

  1. In the Computer Management window, right-click Computer Management (Local).
  2. Select Connect to another computer, then select Another Computer.
  3. Enter the IP address of the computer you want to connect to. If you’re on the same network, it will take the form of an internal LAN address, such 192.168.x.x. Alternatively, if you know the computer name, you can use that, e.g., \\DesktopPC.
windows xp remote access

If you’re unsure and connected to the same network:

  1. Select Browse, then Advanced.
  2. Now, select Find Now to scan your local network for computers on your network.
  3. Once you gain remote access, change the password by heading to System Tools > Local Users and Groups > Users.
  4. Find your user account, right-click, and select Set Password.
windows xp find a computer on the same network

Reset Windows XP Password Using a Linux LiveCD or USB

If you’ve made it this far and are still locked on, this is the Windows XP password reset fix for you.

You can use a Linux LiveCD or USB to unlock Windows XP and reset your password. A Linux LiveCD or USB runs directly from the media and doesn’t require installation. Furthermore, some Linux distributions have special tools for unlocking Windows systems, or you could use a Windows recovery disc.

  1. Make your bootable Linux CD or USB drive. You could also check out how to install Ubuntu via a flash drive.
  2. Reboot the Windows XP machine. Press either F12, ESC, or Delete to choose your boot device. Select your CD or USB drive when prompted.
  3. Press Ctrl + L to edit the Location Type computer:/// to see all your drives. Select your Windows installation, right-click, and select Mount.
  4. Open the Linux Terminal by pressing Ctrl + Alt + T. Run the following command to install password reset utility chntpw: sudo apt-get install chntpw. (Ignoring the period.)
  5. Change the working directory using the following command: cd /mnt/Windows/System32/config
  6. Retrieve a list of Windows users using the following command: sudo chntpw -1 SAM. (Ignoring the period.)
  7. Find your account username. Then, use the following command to select the account: sudo chntpw -u “USER NAME” SAM. Then, type 2to enter editing mode.
  8. Type a new password, hit Enter to submit, and y to confirm.
  9. Reboot into Windows and use the new password.

Display User Full Name

> net user ismail | Find /i "full name"

Set Expire Date For User Account

> net user ismail /expires:21/12/2022

Change User Account Password

net user USER PASSWORD
> net user ismail 123456Ww.

Windows XP Password Reset Complete

One of the tips and tricks we’ve covered should have helped you reset your Windows XP account password. Hopefully, you didn’t have to resort to a full system nuke and reinstall—that can be a real pain!

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 Commands

Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

“net user” Command 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.
net user "ismail" "..3awCse^+!,,"
“net user” Command Tutorial
Open MS-DOS As Administrator

Display User Account Information

> net user ismail
“net user” Command Tutorial
User name                    ismail
Full Name
Comment
User's comment
Country/region code          000 (System Default)
Account active               Yes
Account expires              Never

Password last set            5/13/2022 9:54:12 AM
Password expires             Never
Password changeable          5/13/2022 9:54:12 AM
Password required            No
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   5/13/2022 9:51:59 AM

Logon hours allowed          All

Local Group Memberships      *Administrators       *docker-users
Global Group memberships     *None

Change Domain User Password

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

Reset the Windows Administrator Password With a Microsoft Account

One of the major benefits of using a Microsoft account with Windows is that you can reset your password by going through Microsoft’s tools without much hassle.

First, make sure that you really can’t access your Microsoft account (perhaps your keyboard has a stuck key or something similar). Go to login.live.com on your phone or another computer and try to sign in with the Microsoft account you use on your PC, making sure you don’t mistype anything.

If you still can’t get in here, then proceed with resetting your Microsoft password. Head to the Microsoft password reset page to get started, though you can also reset your password from the Windows login screen by clicking the I forgot my password link.

Microsoft Account Reset Page

After confirming your identity with the details you’ve provided on your account, this page will walk you through resetting your Microsoft account password. Once that’s done, use the new password to sign into your PC.

Forgotten Administrator Password in Windows? No Problem

Anyone can use these methods with a bit of time, and they’re a lot better than completely reinstalling Windows because you’re locked out. And with a little preparation, you can prevent this from happening again in the future.

Add Comment For User Account

> net user USER /comment:COMMENT
> net user ismail /comment:"This is temporary user"

Disable User Account

> net user ismail /Active:No
> net user ismail /Active:No /domain

Reset Windows XP Password Using Safe Mode and Command Prompt

windows xp safe mode command prompt option

To access Windows XP Safe Mode, you need to restart your computer.

  1. Press F8 while the computer is booting. (Sometimes tapping F8 helps if you’re unsure.)
  2. Select Safe Mode with Command Prompt.
  3. Once you enter Safe Mode, head to Control Panel > User Account > Change Account. Then, select the account that you’d like to change the password for, and follow the on-screen instructions.

Reset Windows XP Password Using the Command Prompt

  net user [account name] [new password] 

It should look like this:

windows xp command prompt change password screen
  net user [account name] "" 

Type New Password Interactively and Securely

net user "ismail" *
Type a password for the user: 
Retype the password to confirm: 
The command completed successfully.

Net User Command Examples

Administrator            DefaultAccount           Extra
Guest                    jonfi                    WDAGUtilityAccount
net user administrator
User name                    Administrator
Full Name
Comment                      Built-in account for administering the computer/domain
User's comment
Country/region code          000 (System Default)
Account active               No
Account expires              Never

Password last set            8/24/2020 1:21:25 PM
Password expires             Never
Password changeable          8/24/2020 1:21:25 PM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   11/9/2021 11:48:13 AM

Logon hours allowed          All

Local Group Memberships      *Administrators
Global Group memberships     *None
net user rodriguezr /times:M-F,7AM-4PM;Sa,8AM-12PM

Here’s an example where the rodriguezr account is having its login days and times changed.

net user nadeema r28Wqn90 /add /comment:"Basic user account." /fullname:"Ahmed Nadeem" /logonpasswordchg:yes /workstations:jr7tww,jr2rtw /domain
net user nadeema /delete

Оставьте комментарий