Can I change my own password in Active Directory using Powershell

22,306

If you have the Active Directory PowerShell Module installed, this is a pretty easy task using Set-ADAccountPassword.

You can use the -Server parameter to supply a different Domain Controller name from each Domain to set the password on that Domain.

$DomainControllers = "Domain1DC","Domain2DC","Domain3DC"
$MyName = "MyUserName"
ForEach ($DomainController In $DomainControllers) {
    Set-AdAccountPassword -Identity $MyName -Server $DomainController
}

Set-ADUserAccountPassword used this way will prompt you for the old password then the new password for each domain controller.

Share:
22,306
RkApps0
Author by

RkApps0

Updated on July 09, 2022

Comments

  • RkApps0
    RkApps0 almost 2 years

    I am trying to change password for my own account in AD using powershell. My account is just a regular account (no domain admin rights)

    I tried net user, dsquery and powershell cmdlets, but all of them errors out "Access is denied". I think all of those requires admin rights.

    Is there a way to change my own password using powershell or cmd ?

    Why I am doing that? We have 8 different AD domains and I have an account in each. With different password expiration policies it is very difficult to remember all the passwords. So I want to do a script that connects to each domain with my user account in that domain and changes the password. I'll repeat that for all the domains.

  • CitizenRon
    CitizenRon over 9 years
    It shouldn't. Since it will prompt for the current password of the user account, that should be all the rights it needs to perform the password change.
  • Tilo
    Tilo over 8 years
    simple one by one: Set-AdAccountPassword -Identity AnyDomainUserId no need to run powershell by the user you want to change Also quick info how to import PS of AD: import-module activedirectory