get-adcomputer myServer
This command can only run from computers with the Active Directory Domain Services role.
Set-AdAccountPassword -Identity $env:UserName -OldPassword (Read-Host -asSecureString "Current") -NewPassword (Read-Host -asSecureString "New")
This command will prompt for old and new password.
This command can only run from computers with the Active Directory Domain Services role.
I was running into a problem where my password for my user in a domain that I don't login to regularly was expiring. This meant I was unable to RDP to any computer in that domain and as I'm also not a domain admin for that domain I was unable to change my own password (and I hate disrupting other people to keep fixing this for me)... until I came across this awesome piece of Powershell from Przemyslaw Klys...
https://evotec.xyz/how-to-change-your-own-expired-password-when-you-cant-login-to-rdp/Run it with...
Set-PasswordRemotely -DomainController myDomainController
It will prompt for UserName, OldPassword and NewPassword
If you are already logged into the domain you can omit the DomainController and it will default to your current one.