Change Windows 11 password via Command Prompt or PowerShell

Stefan
Change Windows 11 password via Command Prompt or PowerShell

In Windows 11, users can... change passwords or reset via the Windows Settings app or the Control Panel.

There are other ways to change an account password in Windows. If you local account you can use PowerShell or Command Prompt to reset your account password as well.

A good reason to reset or change a local account password in Windows 11 is if the account has been compromised or the password is no longer secret. You can then simply change it to prevent further problems.

For new users, the easiest way to reset an account password is to use the Windows Settings app. However, if you are familiar with the Command Prompt or Windows PowerShell, you can also use these tools to change password or reset.

Change Windows 11 password via Command Prompt or Terminal

Change Windows 11 password via Command Prompt

Click the Start button to start it startmenu to open. In the search window type: Terminal and right-click on the “Windows Terminal” result and click “Run as administrator”.

Open Windows Terminal in Windows 11

You can now use Windows Terminal to create a Command Prompt open tab. A Command Prompt is called “Command Prompt” in Windows Terminal.

Click the down arrow and click “Command Prompt” in the list. A new tab will now open in the Windows Terminal window.

Open command prompt via terminal

To change the password of a specific local account, you first need to know the username of this account. You can look this up with the command:

net user

Type in and confirm with the enter key. You will now see a list of accounts present in Windows 11. If the account contains spaces, type the username in the following command with quotes.

net user <gebruikersnaam> *

You can now enter a new password for the local account via Command Prompt.

Read also
Add new storage group in Windows 11

How to Change Local Password in Windows 11 via Command Prompt

Change Windows 11 password via PowerShell

Above I showed you how to change a password in Windows 11 using Command Prompt

Another way to change or reset a password with commands is through PowerShell. You can use Windows Terminal to run PowerShell commands from the PowerShell console tab.

Open Windows Terminal, by default the PowerShell tab is selected. Then run the commands below to display a list of users in Windows 11.

Get-LocalUser

get-localuser

Note the user name, you need that. Now you need to set a number of variables, which you must first adjust. You enter these commands one by one.

$wachtwoord = Read-Host "Typ het nieuwe wachtwoord" -AsSecureString
$UserAccount = Get-LocalUser -Name "<Gebruikersnaam>"
$UserAccount | Set-LocalUser -Password $wachtwoord

Change Windows 11 password via powershell

You have now successfully changed the Windows 11 password of a specific user account via PowerShell.

Also read:

I hope this helped you. Thank you for reading!


Problem solved?


Help other people too.
Share this article on a website, forum or via social media.

Join our new computer forum for questions and computer help.
3 comments
  1. I have been having a Windows error with stop code 0XC000021A for a while now. Now I want to fix this and have looked up some videos to do so. The problem, however, is that I can't remember my password for my PC. I have to enter this password when I want to open the CommandPropt, for example. Can I request this somewhere or something like that? Would like to hear.

Do you have a computer question?

The email address will not be published. Required fields are marked with *