Last active
March 12, 2020 08:23
-
-
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
This file contains 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
$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