Active Directory
Find the source of an account lockout
Use event 4740 on the PDC emulator to find which computer keeps locking an account, then find the stale credential on that computer.
When an account locks out, the domain controller that saw the failed attempts forwards the lockout to the PDC emulator, which logs event 4740 in its Security log. The event names the computer the bad passwords came from.
1. Check the account
1Get-ADUser jdoe -Properties LockedOut, lockoutTime, badPwdCount, LastBadPasswordAttempt |2 Select-Object Name, LockedOut, badPwdCount, LastBadPasswordAttempt2. Read the lockout events on the PDC emulator
1$pdc = (Get-ADDomain).PDCEmulator2Get-WinEvent -ComputerName $pdc -FilterHashtable @{ LogName = 'Security'; Id = 4740 } -MaxEvents 50 |3 Select-Object TimeCreated,4 @{ n = 'User'; e = { $_.Properties[0].Value } },5 @{ n = 'Caller'; e = { $_.Properties[1].Value } } |6 Where-Object User -eq 'jdoe'Caller is the Caller Computer Name. If it's empty, the attempts came through a service that doesn't pass the workstation name (for example some VPN, RADIUS or Exchange paths) — check those servers' logs next.
No 4740 events at all? Account management auditing must be enabled on domain controllers (Audit User Account Management, Success). It's on by default in the Default Domain Controllers Policy.
3. Find the stale credential on the caller
On the computer from step 2, look for failed logons (4625) to see the process, then check the usual suspects:
- Credential Manager — saved Windows credentials (
rundll32 keymgr.dll,KRShowKeyMgr). - Mapped drives and persistent connections (
net use). - Services and scheduled tasks running as the user.
- Mobile devices with old mail passwords (Exchange ActiveSync).
- Disconnected RDP sessions still logged on with the old password.
4. Unlock
1Unlock-ADAccount -Identity jdoeReferences
- 4740(S): A user account was locked out — Microsoft Learn