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 }
Advertisements
Reset AD Computer Password

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s