Skip to content

Instantly share code, notes, and snippets.

@kgriffs
Last active July 7, 2021 16:13
Show Gist options
  • Save kgriffs/e27537df300dd264bcb9f41d21e2d3a9 to your computer and use it in GitHub Desktop.
Save kgriffs/e27537df300dd264bcb9f41d21e2d3a9 to your computer and use it in GitHub Desktop.
Change user password on Windows from Powershell
# Credit: https://blog.netwrix.com/2018/10/16/how-to-create-change-and-test-passwords-using-powershell/
# RDP: 3389
$Password = (Read-Host -Prompt "New Password" -AsSecureString)
$User = (Read-Host -Prompt "Username")
$UserAccount = Get-LocalUser -Name $User
$UserAccount | Set-LocalUser -Password $Password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment