Skip to content

Instantly share code, notes, and snippets.

@jstangroome
Created July 11, 2012 01:58
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jstangroome/3087453 to your computer and use it in GitHub Desktop.
Save jstangroome/3087453 to your computer and use it in GitHub Desktop.
Change your own Active Directory password from PowerShell without any special permissions
([adsi]'WinNT://domain/username,user').ChangePassword('oldpassword','newpassword')
@wim-beck
Copy link

wim-beck commented Mar 2, 2017

An equivalent using a powershell cmdlet from the ActiveDirectory module:

Set-AdAccountPassword -Identity $AccountName -OldPassword (Read-Host -asSecureString "Enter the current password") -NewPassword (Read-Host -asSecureString "Enter the new password")

This cmdlet does not require a distinguishedname, so it is a bit easier to use.

More info: https://technet.microsoft.com/en-us/library/ee617261.aspx
I landed on your gist by researching this., I had a similar gist: https://gist.github.com/wim-beck/c402e54b47ab852701be800af6206073

@hxsf
Copy link

hxsf commented May 5, 2017

👍 I search for no dependency solution all day, It cool!

thanks a lot

@virtualdreams
Copy link

Nice, thank you!

@pestkaonline
Copy link

Thank you, it helped a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment