In our network, we have about 9k workstations. As a security measure, we are changing the Local Admin account’s password each 3 months.
The actual script that does this job is an old vbs that I’m trying to get rid of, and re-do the job in PS.
I tried this, but I get no error, and when I try to run as that local admin, I get an access denied, so it is obvious that the password was not changed.
Can someone tell me what I’m doing wrong?
$pass = convertTo-secureString -string ‘This is a test password’ -asPlainText -force
get-localUser -name ‘xxxx’ | set-localUser -password $pass