Event ID 4740: Find What Is Locking Out an AD Account

Find what keeps locking out an Active Directory account: read Event ID 4740 on the PDC emulator with Get-WinEvent, take the Caller Computer Name, then check 4625 on that computer and 4771 or 4776 on the domain controllers.

Home › Guides › Account lockout source (4740)

Last updated 18 November 2026

Quick answer

  1. Account lockout is processed on the PDC emulator (Microsoft's [MS-ADTS] specification says so in as many words), so start there. Find it with (Get-ADDomain).PDCEmulator.
  2. On the PDC emulator, read Event ID 4740 (A user account was locked out) in the Security log and note the Caller Computer Name: Microsoft defines it as the computer the logon attempt came from, after which the account was locked out.
  3. On that computer, read Event ID 4625 (An account failed to log on). It is logged on the computer where the logon attempt was made, and its Caller Process Name, Logon Type and Source Network Address tell you which program or remote host is sending the bad password.
  4. If the caller is a server that only relays the sign-in, check 4771 (Kerberos) and 4776 (NTLM) on the domain controllers for the client address or source workstation behind it.

Look up any other ID you meet along the way in the Windows Event ID Lookup.

Why the PDC emulator has the 4740

Microsoft's Active Directory technical specification ([MS-ADTS] 6.1.5.4, PDC Emulator FSMO Role) lists what the PDC emulator does:

There is one PDC emulator per domain. Its name is in the PDCEmulator property that Get-ADDomain returns (Microsoft's example output shows PDCEmulator : User04-DC1.User04.com). The 4740 event itself is generated for user accounts on domain controllers, member servers and workstations, and it belongs to the Audit User Account Management audit subcategory, so that subcategory has to be audited on the DCs for the event to appear.

Step 1: List locked-out accounts

With the Active Directory module (RSAT), Microsoft's example lists every locked-out account:

Search-ADAccount -LockedOut | FT Name,ObjectClass -A

Unlock one by SAM account name or distinguished name once you have found the cause (unlocking first just lets the source lock it again):

Unlock-ADAccount -Identity PattiFu

Step 2: Read 4740 on the PDC emulator with PowerShell

$pdc = (Get-ADDomain).PDCEmulator
Get-WinEvent -ComputerName $pdc -FilterHashtable @{
    LogName   = 'Security'
    Id        = 4740
    StartTime = (Get-Date).AddDays(-1)
} | ForEach-Object {
    $d = @{}
    ([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
    [pscustomobject]@{
        Time           = $_.TimeCreated
        User           = $d.TargetUserName
        CallerComputer = $d.TargetDomainName
    }
}

Microsoft also points out that a computer outside your domain still shows up as a computer name rather than an IP address in 4740.

Step 3: Find the process on the caller computer (4625)

Run the same kind of query on the computer named in Caller Computer Name. 4625 is logged in the Audit Logon and Audit Account Lockout subcategories:

Get-WinEvent -ComputerName WIN81 -FilterHashtable @{LogName='Security'; Id=4625; StartTime=(Get-Date).AddDays(-1)} |
  ForEach-Object {
    $d = @{}
    ([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
    [pscustomobject]@{ Time=$_.TimeCreated; User=$d.TargetUserName; Status=$d.Status; SubStatus=$d.SubStatus
      LogonType=$d.LogonType; Process=$d.ProcessName; SourceIP=$d.IpAddress; Workstation=$d.WorkstationName }
  } | Where-Object User -eq 'jdoe'

What to read in each event:

Field (XML name)What it tells you
Caller Process Name (ProcessName)Full path of the executable that attempted the logon.
Logon Type (LogonType)2 interactive, 3 network, 4 batch (processes running for a user without direct intervention), 5 service (started by the Service Control Manager), 7 unlock, 8 network cleartext, 9 new credentials, 10 remote interactive (Remote Desktop), 11 cached interactive.
Source Network Address (IpAddress)IP address of the machine the attempt came from. ::1 or 127.0.0.1 means the local computer.
Workstation Name (WorkstationName)Machine name the attempt was performed from.
Status / Sub StatusWhy it failed, for example 0xC000006A (bad password) or 0xC0000234 (account locked out). The full list is in 4625 status and sub status codes.

Logon type 5 means a service started by the Service Control Manager is using the account, and type 4 a batch process running on the user's behalf without their direct intervention; either way, look for a stored copy of the old password. Type 3 with a remote Source Network Address means the attempts come from another machine, so repeat the step there. Check who owns an unfamiliar public address with the ASN IP Lookup or Cloud IP Lookup, and whether an internal one is in your server ranges with the IPv4 Subnet Calculator.

Microsoft also notes that failed attempts to unlock a workstation can lock the account even when Interactive logon: Require Domain Controller authentication to unlock workstation is disabled: entering a password different from the one you logged on with makes Windows contact a domain controller in case the password was changed on another machine.

Step 4: When the caller is a server or a DC (4771 and 4776)

If the Caller Computer Name is a server that authenticates users on their behalf, the original client is in the domain controller logs:

Because a DC forwards bad-password attempts to the PDC emulator, query each DC as well as the PDC emulator when you are looking for 4771 and 4776 events.

Check the lockout policy

The three settings are under Computer Configuration\Windows Settings\Security Settings\Account Policies\Account Lockout Policy:

SettingValuesNotes from Microsoft
Account lockout threshold0 to 999 failed sign-ins; 0 means never lockDefault domain policy is 0. Windows security baselines suggest 10 as an acceptable starting point.
Account lockout duration0 to 99,999 minutes; 0 means locked until an administrator unlocks itMust be greater than or equal to the reset counter value when the threshold is above 0. Microsoft calls about 15 minutes advisable.
Reset account lockout counter after1 to 99,999 minutesTime after a failed sign-in before the counter goes back to 0. Windows security baselines recommend 15.

Microsoft warns that any threshold above 0 also lets an attacker who knows account names lock them out with nothing more than network access, so a sudden wave of 4740 events across many accounts deserves a security review rather than a round of unlocks.

Related tools and guides

Look up any event ID in the Windows Event ID Lookup, keep these cmdlets in the PowerShell Cheat Sheet, check who owns a source IP with the ASN IP Lookup and Cloud IP Lookup, test whether it is inside your ranges with the IPv4 Subnet Calculator or IPv6 Subnet Calculator, and generate a strong new password for a service account with the UUID / Password Generator. Related guides: Event ID 4625 status and sub status codes and the trust relationship between this workstation and the primary domain failed.

FAQ

Where is Event ID 4740 logged?

In the Security log. For domain accounts read it on the PDC emulator, because Microsoft's Active Directory specification says account lockout is processed there. The event can also be generated on other domain controllers, member servers and workstations.

What does Caller Computer Name mean in event 4740?

It is the computer the logon attempt was received from, after which the account was locked out. In the event XML that value is stored in the TargetDomainName data field. Microsoft notes a computer outside your domain still appears as a name, not an IP address.

How do I find the PDC emulator with PowerShell?

Run (Get-ADDomain).PDCEmulator with the Active Directory module. The PDCEmulator property holds the fully qualified name of the domain controller that owns the role, and there is one per domain.

Why is the Caller Computer Name a server or a domain controller?

That machine received the failed logon on behalf of the real client. Check event 4625 on it for the Source Network Address, and check 4771 (Kerberos, Client Address) and 4776 (NTLM, Source Workstation) on the domain controllers to find the client behind it.

How do I unlock the account after finding the source?

Fix the source first, for example the service, scheduled task or device using the old password, then run Unlock-ADAccount -Identity with the SAM account name or distinguished name. If the lockout duration is not 0, the account also unlocks by itself when the duration expires.

Want the full kit?

Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.