Reset AD Computer Password

At times I need to rollback a virtual snapshot of a server(s). ¬†Before taking the snapshot I make sure that the affected server(s) won’t be changing their passwords soon. ¬†If they are I force them to update their password.

$Computers = 'SERVER01','SERVER02','SERVER03'
# Get the current password dates
ForEach ($C in $Computers) { Get-ADComputer $C -Properties PasswordLastSet | Select Name , PasswordLastSet}
# Run the command on each server
Invoke-Command -ComputerName $Computers -ScriptBlock { Reset-ComputerMachinePassword -Verbose }
Reset AD Computer Password