On Windows 11, you can change the password of a local account using PowerShell commands in addition to using Command Prompt and Control Panel.
Usually, it’s no longer recommended to change the password if it hasn’t been compromised since it could lead to many other problems. However, if the password of your Windows 11 account has been compromised, or you realized it’s easy to guess, you can change it using PowerShell.
In this guide, you will learn the steps to use PowerShell to change the current password of a Windows 11 local account.
Change account password on Windows 11 with PowerShell
To change a local account password with PowerShell command on Windows 11, use these steps:
-
Open Start.
-
Search for PowerShell, right-click the top result, and select Run as administrator.
-
Type the following command to list all the available accounts and press Enter:
Get-LocalUser
-
Type the following command to create and store the new password in a variable and press Enter:
$Password = Read-Host "Enter the new password" -AsSecureString
-
Type the new password for the account and press Enter.
-
Type the following command and press Enter on each line to apply the new password to the local account:
$UserAccount = Get-LocalUser -Name "tempuser" $UserAccount | Set-LocalUser -Password $Password
In the second command, make sure to replace “tempuser” with the name of the account to reset its password.
Once you complete the steps, sign out and sign back into Windows 11 using the new password.
If you have to reset a password using Command Prompt, then use this other guide. Also, even though, this guide focuses on Windows 11, the above steps should also work on Windows 10, Windows 8.1, and Windows 7.