Hi all,
Today I got a request to reset Local Admin password from Windows XP and Windows 7 machines.
After Microsoft released this update https://support.microsoft.com/en-us/kb/2962486?wa=wsignin1.0 Group Policy Preferences stopped working as a way to reset Local passwords.
So below is a script that will do the job. You can run it from a server with domain admin rights and kaboom! You will have a new Local Admin password.
ForEach-Object {add-content
-path C:pathservers.txt
-value $_.Name}
“SilentlyContinue”
Get-Date
in get-content
C:pathservers.txt)
new-object System.Net.NetworkInformation.Ping
$null
$ping.send($strComputer)
‘Success’)
+ $strComputer
+ “/administrator,
user”)
“NEW LOCAL ADMIN PASSWORD HERE”)
C:pathservers-reset.txt -Value “Administrator-password
on $strComputer reset $date”