Answer · High impact

A user account keeps locking out every few minutes

Symptom

The user is locked out again minutes after the service desk unlocks the account.

Cause

An old password is cached somewhere: a phone mail profile, a mapped drive, a scheduled task, a service, or a second device still signed in.

Resolution

  1. Find the domain controller holding the PDC emulator role.

  2. Read event 4740 on it to get the caller computer name.

  3. On that computer, check credential manager, mapped drives, scheduled tasks and services for the old password.

  4. Remove the stale credentials, then unlock the account.

Script

PowerShell
$pdc = (Get-ADDomain).PDCEmulator
Get-WinEvent -ComputerName $pdc -FilterHashtable @{ LogName = "Security"; Id = 4740 } -MaxEvents 50 |
  Where-Object { $_.Properties[0].Value -eq "asha" } |
  Select-Object TimeCreated, @{ n = "Caller"; e = { $_.Properties[1].Value } }
Unlock-ADAccount asha
Disclaimer. These samples are provided as is, without warranty of any kind. Read and test every script in a non-production tenant before you run it, and run reports before any command that changes or deletes data.