Change Windows 11 password via Command Prompt or PowerShell

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

There are other ways to change the password of an account in Windows. If you have one 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 avoid further problems.

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

Change Windows 11 password via Command Prompt or Terminal

Change Windows 11 password via Command Prompt

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

Open Windows Terminal in Windows 11

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

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 for a specific local account, you must first know the username of that account. You can find this by the command:

net user

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

net user <gebruikersnaam> *

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

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 a password or reset it with commands is through PowerShell. You can use Windows Terminal to run PowerShell commands through 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

Make a note of the username you need. Now you need to set some variables, you need to adjust this variable first. 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 through PowerShell.

Also read:

I hope you have helped with this. Thanks for reading!