We have 13 domain controllers in 5 Active directory sites, Unlock status is not updating in All DC's immediately. please help me to unlock Ad user from all the Domain controllers.
Below is the script to unlock Ad account from one domain controller:
Clear-Host
$luser = Read-Host “Input the name (Last name, First name) of the locked user”
$lockstatus = Get-ADUser "$luser" –Properties lockedout -Server DC10
if ($lockstatus.lockedout –eq $True)
{
$nul = Get-ADUser "$luser" | Unlock-ADaccount
$nul = Get-ADUser "$luser" | Set-ADAccountPassword -NewPassword “password”
Write-Host "Account unlocked and password reset"
}
if ($lockstatus.lockedout –eq $false)
{
Write-Host "Account is not locked"
}
Raj