Skip to content

Instantly share code, notes, and snippets.

@eizedev
Last active March 12, 2020 08:23
Show Gist options
  • Save eizedev/d914d673f9def09e5cbb35693ee5de4c to your computer and use it in GitHub Desktop.
Save eizedev/d914d673f9def09e5cbb35693ee5de4c to your computer and use it in GitHub Desktop.
Change your own Active Directory password from PowerShell without any special permissions in a remote domain
$domain = "domain name"
$username = "user name"
$User = $username + "@" + $domain
$Password = (Read-Host -asSecureString "Enter the current password")
$Credential = New-Object System.Management.Automation.PSCredential ($User, $Password)
Set-ADAccountPassword -Credential $Credential -Server $domain -Identity $userName -OldPassword $Password -NewPassword (Read-Host -asSecureString "Enter the new password")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment