Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

PowerShell script to change AD password remotely

$
0
0

Hi,

I'm trying to make a script in PowerShell for people in my organization to change their AD password.

Some users of our organization aren't at the same domain (different organizations) but, their network can access mine.

So, today... those guys need to use the remote desktop to connect to one of our machines and logon to be able to change their passwords.

I wanted a way to create a script to put in a shared folder to allow them to change their passwords from that network or from VPN.

What I've had in my mind is something like this:

$ADcred = ??? (need to specify the account admin in here: user + password)

$user = Read-Host "Type username:"

$password = Read-Host "Type password:" -AsSecureString

Set-ADAccountPassword -Identity $user -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $password -Force) -Credential $ADcred


Then I'm thinking about creating an EXE to protect that password in the code...

Any help please?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>