Can I change my own password in Active Directory using Powershell
Asked Answered
E

1

6

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.

Emmaline answered 14/8, 2014 at 15:26 Comment(1)
Have you looked into the Set-ADAccountPassword cmdlet?Porthole
C
11

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.

Caliche answered 14/8, 2014 at 16:2 Comment(3)
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.Caliche
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 activedirectoryMorganatic
how to install the AD PS module: check Get-WindowsFeature RSAT-AD* | FT -a and install via Install-WindowsFeature RSAT-ADDSMorganatic

© 2022 - 2024 — McMap. All rights reserved.