This guide shows you how to change a local Windows 11 account password using PowerShell, a built-in command-line tool. It works for your own account or another local account if you have administrator rights. You’ll need to run PowerShell as administrator, and you’ll need the current password if you’re changing your own account.
What You’ll Need
- Windows 11 PC with a local account (not a Microsoft account)
- Administrator access to open PowerShell elevated
- Current password for the account you’re changing (if you’re not an admin changing someone else’s)
Step-by-Step
- Open PowerShell as Administrator. Click the Start button, type
powershell, right-click Windows PowerShell in the results, and select Run as administrator. Click Yes on the User Account Control prompt. - Check the current user. Type
whoamiand press Enter. This shows your username, confirming you’re in the right context. - List local accounts (optional). To see all local users, type
Get-LocalUserand press Enter. Note the exact Name of the account you want to change. - Change your own password. Type the following and press Enter:
net user %USERNAME% *
PowerShell will prompt you to enter a new password. Type it (characters won’t show) and press Enter, then type it again to confirm. - Change another account’s password (admin only). Type:
net user <Username> *
Replace<Username>with the actual account name, e.g.,net user jsmith *. Press Enter, then enter and confirm the new password when prompted. - Verify the change (optional). To confirm the password was updated, you can sign out and sign in with the new password, or use
Get-LocalUserto check the account still exists (it won’t show the password).
Common Mistakes
- Not running as administrator: You’ll get an “Access is denied” error if PowerShell isn’t elevated when changing another user’s password.
- Typing the username wrong: The username must match exactly, including case and spaces. Use
Get-LocalUserto copy it. - Using a Microsoft account: This method only works for local accounts. If your account uses an email address to sign in, you’re using a Microsoft account and should change the password on Microsoft’s website instead.
- Mistyping the password: Since characters don’t show as you type, it’s easy to make a typo. Use the confirm prompt to catch it.
Tips
- Use a strong password with a mix of upper and lowercase letters, numbers, and symbols.
- Consider using a password manager to store the new password securely.
- If you’re an admin resetting a user’s password, inform them of the new password securely (e.g., in person) and encourage them to change it after signing in.
- You can also use the
Set-LocalUsercmdlet for more control, butnet useris simpler for a quick change.
Troubleshooting
“Access is denied” error: You’re not running PowerShell as administrator. Close and reopen it with “Run as administrator.”
“The user name could not be found” error: The username is incorrect or the account is a Microsoft account. Check the exact name with Get-LocalUser and confirm it’s a local account.
Password prompt doesn’t appear: If you used net user username newpassword (with the password in the command), it will change directly without a prompt. That’s fine, but be aware the password is visible in the command history. Use the asterisk method instead.
Can’t sign in after change: Ensure Caps Lock is off and you’re entering the password exactly as set. If you’re locked out, you may need to use another admin account or a password reset disk.
Frequently Asked Questions
Can I change a Microsoft account password with PowerShell?
No. Microsoft account passwords are managed online. Use the Microsoft account security page or the Settings app to change them.
Do I need to be an administrator to change my own password?
No, you can change your own password without admin rights, but you’ll need to provide your current password when prompted.
What if I forgot my current password?
If you’re an administrator, you can reset another user’s password without knowing the old one. If you forgot your own and there’s no other admin account, you’ll need to use a password reset disk or reinstall Windows.
Is there a way to change the password without typing it in the terminal?
Yes, using the asterisk method (net user username *) prompts you to enter the password invisibly, which is safer than typing it in the command line.
Will this work in Windows PowerShell 5.1 and PowerShell 7?
Yes, the net user command works in both, as long as you run the terminal as administrator for other users’ passwords.
Can I set a password that never expires?
Yes, but that’s a security risk. To do it, use net user username /expires:never and then set the password. However, it’s better to keep password expiration enabled for security.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- iOS 18 Safari Not Working? Fixes That Help
- How to Check Your Linux Kernel for Spectre
- iPhone Safe Mode: How to Enable or Disable It
- Fix Slow Internet Lag on Samsung Galaxy Note
- How to Get iOS 17 on iPhone X (Safe Methods)
- Fix Gmail IMAP Error in Outlook: Step-by-Step