Last active
July 7, 2021 16:13
-
-
Save kgriffs/e27537df300dd264bcb9f41d21e2d3a9 to your computer and use it in GitHub Desktop.
Change user password on Windows from Powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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