Event ID 4740: account locked out
What Event ID 4740 (account locked out) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.
Event ID 4740 means an account was locked out. It is logged on the domain controller, usually the PDC emulator, and its most useful field is the computer the bad attempts came from. That turns "my account keeps locking" from a mystery into a five-minute fix.
The fields that matter
| Field | What it tells you |
|---|---|
| Target Account | The account that was locked. |
| Caller Computer Name | The machine the failed attempts came from. |
| Subject | Usually the domain controller itself. |
What is normal
A user who changed their password and still has the old one saved on a phone, a mapped drive or another session.
When Event ID 4740 is suspicious
- Many different accounts locked out within minutes: password spraying that exceeded the lockout threshold.
- Lockouts of admin or service accounts.
- A caller computer name you don't recognise, or one that is blank.
Common false positive: Phones syncing mail through Exchange often show the Exchange server as the caller. Check that server's logs for the device behind it.
Find Event ID 4740 with PowerShell
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4740; StartTime=(Get-Date).AddDays(-7)} -MaxEvents 50 |
ForEach-Object {
$d = [ordered]@{ Time = $_.TimeCreated; Computer = $_.MachineName }
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]$d
} | Format-List
Microsoft Sentinel (KQL)
SecurityEvent
| where TimeGenerated > ago(7d) and EventID == 4740
| project TimeGenerated, Computer, Account, Activity, EventData
| order by TimeGenerated desc
Related events
- Event ID 4625: Failed logon
- Event ID 4771: Kerberos pre-authentication failed
- Event ID 4776: NTLM credential validation
- Event ID 4767: Account unlocked
FAQ
How do I find the source of repeated lockouts?
Take the Caller Computer Name from 4740, then look at 4625 events on that machine for the account: the process name and logon type show what is using the old password.
Which event shows an account being unlocked?
4767.
Windows Event Triage reads a CSV, EVTX-to-JSON or XML export in your browser and flags brute force, new admins, suspicious services and log clearing.
IOC Triage, our free browser extension: right-click it for a verdict from 15 threat-intel sources, then copy a ready ticket note.