Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I change my own password in Active Directory using Powershell

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.

like image 493
RkApps0 Avatar asked Aug 14 '14 15:08

RkApps0


People also ask

Can you reset your own password in Active Directory?

Log in to a domain-connected computer and open the Active Directory Users and Computers console. Find the user account whose password you want to reset. In the right pane, right-click on the user account and select Reset Password. Type the new password and enter it again to confirm.


1 Answers

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.

like image 55
CitizenRon Avatar answered Oct 09 '22 20:10

CitizenRon