Managing user accounts efficiently is essential for both system administrators and advanced users. With PowerShell, you can securely change local account passwords on Windows 11 without relying on the graphical interface.

This guide walks you through multiple proven methods—from the most secure approaches to quick command-line alternatives—so you can choose what best fits your workflow.

Important: Local Accounts Only

Before you begin, keep this in mind:

  • These methods only work for local accounts
  • If you’re using a Microsoft account, you must change your password via your online account settings

Method 1: Secure Password Change Using Get-LocalUser and Set-LocalUser

This is the recommended method because it avoids exposing your password in plain text.

Step 1: Open PowerShell as Administrator

  • Open Start Menu
  • Search for PowerShell
  • Click Run as administrator
  • Confirm the UAC prompt
how to change an account password using powershell on windows 11 25h2

Step 2: List All Local Users

Get-LocalUser
1 how to change an account password using powershell on windows 11 25h2

This command displays all local accounts on your system.

Step 3: Create a Secure Password

$Password = Read-Host "Enter new password" -AsSecureString
2 how to change an account password using powershell on windows 11 25h2
  • Type your new password when prompted
  • It will be stored securely as an encrypted string

Step 4: Select the User Account

$UserAccount = Get-LocalUser -Name "Username"

Replace "Username" with the actual account name.

Step 5: Apply the New Password

$UserAccount | Set-LocalUser -Password $Password
3 how to change an account password using powershell on windows 11 25h2

✅ The password is now updated securely.

Method 2: Using Set-LocalUser with ConvertTo-SecureString

This method is faster but includes the password in the command (less secure if exposed).

Command:

Set-LocalUser -Name "Username" -Password (ConvertTo-SecureString -AsPlainText "NewPassword" -Force)

Example:

Set-LocalUser -Name "kalki51" -Password (ConvertTo-SecureString -AsPlainText "tax234@52" -Force)
4 how to change an account password using powershell on windows 11 25h2

Key Notes:

  • ConvertTo-SecureString converts plain text into a secure format
  • No confirmation message will appear
  • Test by logging in with the new password

Method 3: Change Password Using WMI (Win32_UserAccount)

This approach uses Windows Management Instrumentation for account management.

Step 1: Get the User Object

$user = Get-WmiObject Win32_UserAccount -Filter "Name='Username'"

Step 2: Set the New Password

$user.SetPassword("NewPassword")

Example:

$user = Get-WmiObject Win32_UserAccount -Filter "Name='kalki52'"
$user.SetPassword("pswd12345")
5 how to change an account password using powershell on windows 11 25h2

✅ The password is updated immediately.

Method 4: Using the Net User Command (Quick but Less Secure)

This is the fastest method—but also the least secure.

Command:

net user Username NewPassword

Example:

net user kalki51 Saht!3225
6 how to change an account password using powershell on windows 11 25h2

⚠️ Warning:

  • Password is stored in plain text
  • Can be visible in command history
  • Use only when necessary and clear history afterward

Best Practices for Password Changes

To keep your system secure:

  • Prefer secure string methods (Method 1)
  • Avoid plain text passwords in scripts
  • Use strong passwords (mix of letters, numbers, symbols)
  • Clear PowerShell history if sensitive data was used

Conclusion

Using PowerShell to change local account passwords on Windows 11 gives you unmatched control, flexibility, and efficiency—especially when managing multiple users.

For most users, the Get-LocalUser + Set-LocalUser method offers the best balance of security and usability. Meanwhile, advanced users can leverage WMI or quick commands depending on their needs.

By mastering these techniques, you can streamline account management and maintain stronger security across your system.

Support Tech2Geek ❤️

AI-powered search engines are making it harder for small independent blogs like ours to survive. If you find our guides helpful, please consider supporting us.

You can help by sharing our articles or making a small donation.

☕ Make a Small Donation

Every contribution helps us keep creating free tech guides and reviews.

Categorized in: