Avatar of Andrew N. Kowtalo
Andrew N. Kowtalo
 asked on

Need Help adding a stipulation

Set-ADAccountPassword sampleuser -Reset -NewPassword (ConvertTo-SecureString -AsPlainText “samplepw” -Force -Verbose) –PassThru

Can someone tell me how to add a stipulation to this PowerShell line to unlock the AD account as well?   
PowershellMicrosoftWindows OSScripting Languages

Avatar of undefined
Last Comment
oBdA

8/22/2022 - Mon
oBdA

There's Unlock-ADAccount for that:
Set-ADAccountPassword -Identity sampleuser -Reset -NewPassword (ConvertTo-SecureString -String 'samplepw' -AsPlainText  -Force -Verbose) -PassThru | Unlock-ADAccount -Verbose

Open in new window

Kimputer

Andrew N. Kowtalo

ASKER
So theres no way to add that to my line to unlock and reset all together?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Andrew N. Kowtalo

ASKER
@obda is that it?
ASKER CERTIFIED SOLUTION
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.