Skip to content

How to Find Locked-Out User Accounts in Active Directory

Find locked-out AD accounts fast with Search-ADAccount, trace the lockout source using event ID 4740 on the PDC Emulator, and fix the cause with the right tools.

MGMCSA Guru Team August 15, 2026 7 min read
Diagram-style cover showing an admin querying Active Directory for locked-out accounts and tracing event ID 4740 back to the source machine on the PDC Emulator

Account lockouts are one of the most common help desk tickets in any AD environment, and one of the most frustrating to chase. The user swears they typed the right password. You unlock the account. It locks again ten minutes later. Somewhere out there a device is quietly hammering the directory with an old password, and the account pays for it.

Finding the locked accounts is the easy part — one PowerShell command does it. The real work is tracing why an account keeps locking, and that trail starts at the PDC Emulator with event ID 4740.

This guide covers both: listing locked accounts quickly, reading the lockout events to find the source machine, the usual culprits behind a repeat offender, and how the lockout policy itself shapes how often this happens.

List locked-out accounts with PowerShell

The fastest way to see every currently locked account in the domain is Search-ADAccount. Run it from any machine with the Active Directory PowerShell module (RSAT or a DC):

# Every locked-out account in the domain
Search-ADAccount -LockedOut | Select-Object Name, SamAccountName, LastLogonDate

That returns the accounts sitting in a locked state right now. To unlock a single account once you know it’s safe:

Unlock-ADAccount -Identity jsmith

And to clear several at once — only after you’ve confirmed there isn’t an active attack or a misfiring device behind them:

# Unlock every locked account (use with care)
Search-ADAccount -LockedOut | Unlock-ADAccount

Why lockout events live on the PDC Emulator

When an account locks out, the event is recorded as event ID 4740 in the Security log — and it’s written on the PDC Emulator. That’s by design. Whenever any DC rejects a bad password, it forwards that attempt to the PDC Emulator, which keeps the authoritative count and decides when the threshold is crossed. So the PDC Emulator is the one machine that sees every lockout in the domain.

Find which DC holds the role first:

# Identify the PDC Emulator
(Get-ADDomain).PDCEmulator

That’s the server whose Security log you’ll be reading. If you’re fuzzy on what the PDC Emulator does and why it’s special, see transfer or seize FSMO roles — it carries the lockout-processing role along with time sync and password handling.

Read event 4740 to find the source

Event 4740 is the one that matters. It records the locked account and the machine the bad attempts came from. Pull recent lockout events from the PDC Emulator:

$pdc = (Get-ADDomain).PDCEmulator

Get-WinEvent -ComputerName $pdc -FilterHashtable @{
    LogName = 'Security'
    Id      = 4740
} -MaxEvents 20 |
Select-Object TimeCreated,
  @{N='LockedAccount'; E={$_.Properties[0].Value}},
  @{N='SourceComputer'; E={$_.Properties[1].Value}}

The two fields you care about are the locked account and the Caller Computer Name (the source). The source is your lead — it’s the machine that submitted the failing password.

What event 4740 tells you

TimeCreated When the lockout happened — match it against when the user noticed.
Target Account Name The account that got locked out.
Caller Computer Name The machine the bad attempts came from (or a relay, see below).

The usual suspects behind a repeat lockout

When an account relocks within minutes of every unlock, a cached old password is almost always to blame. Once you’ve identified the source machine from event 4740, check these in roughly this order:

Where stale credentials hide

  • Mobile devices with a saved Exchange/email password (phones are the #1 cause)
  • Mapped network drives using saved credentials
  • Saved credentials in Windows Credential Manager
  • Scheduled tasks configured to run as the user
  • Windows services running under the user's account
  • Persistent RDP sessions or saved RDP credentials
  • Application pools or scripts with a hard-coded password
  • A second machine where the user is still logged in with the old password

The pattern is always the same: the user changed their password, but something is still trying the old one on a loop. Update or clear the cached credential on the source device and the lockouts stop.

# On the source machine, list saved credentials
cmdkey /list

# Remove a stale saved credential
cmdkey /delete:targetname

Tune the account lockout policy

How easily accounts lock at all is governed by the account lockout policy, set in Group Policy — usually the Default Domain Policy, under Computer Configuration → Policies → Windows Settings → Security Settings → Account Policies → Account Lockout Policy.

Account lockout policy settings

Account lockout threshold Bad attempts before lockout. ~10 is a common balance; 0 disables lockout entirely (not recommended).
Account lockout duration How long the account stays locked. 15–30 min, or 0 to require an admin unlock.
Reset account lockout counter after How long before the bad-attempt count resets. Often 15 minutes.
# View the current lockout policy
Get-ADDefaultDomainPasswordPolicy |
  Select-Object LockoutThreshold, LockoutDuration, LockoutObservationWindow

Quick workflow

When a lockout ticket lands, this is the fast path from symptom to root cause:

  1. Search-ADAccount -LockedOut — confirm the account is actually locked.
  2. (Get-ADDomain).PDCEmulator — find the DC that logs lockouts.
  3. Pull event 4740 from that DC — get the source computer name.
  4. Trace the source (and any relay behind it) to the stale credential.
  5. Update or remove the cached password, then Unlock-ADAccount.

Wrapping up

Finding locked accounts takes one command. Stopping them from relocking takes a little detective work: go to the PDC Emulator, read event 4740, and follow the source computer back to whatever is still clutching the old password — usually a phone, a mapped drive, or a service account.

Unlocking without finding the cause just resets the timer, and you’ll see the same ticket again before lunch. Trace it once, fix the cached credential, and it stays fixed. If lockouts are happening across many accounts at once rather than one repeat offender, treat it as a possible password-spray attempt and review your defenses with the Windows Server hardening checklist.

Frequently asked questions

How do I list all locked-out accounts in Active Directory?

Run Search-ADAccount -LockedOut from a machine with the AD PowerShell module. It queries the directory and returns every account currently in a locked-out state across the domain. You can pipe it to Unlock-ADAccount to clear them, but find the cause first so they don't just lock again.

Where is the event that tells me why an account locked out?

Event ID 4740 in the Security log records each lockout, and it's written on the PDC Emulator because that role processes lockouts for the whole domain. The event includes the account name and the Caller Computer Name — the machine the bad attempts came from — which is the clue you need to fix the root cause.

Why does an account keep locking out right after I unlock it?

Almost always a stale credential somewhere: a phone with an old Exchange password, a mapped drive, a saved RDP session, a scheduled task, or a service running as the user. The device retries the old password automatically and trips the lockout again. Unlocking treats the symptom; you have to find and update the cached credential.

Does the lockout event always point to the exact device?

The Caller Computer Name in event 4740 names the machine that submitted the bad attempts, which is often a server (like an Exchange or RD Gateway) that's relaying authentication rather than the real source device. Treat it as the first hop and trace further when it points at an intermediary.

Can I unlock an account with PowerShell?

Yes. Use Unlock-ADAccount -Identity to clear a single account, or pipe Search-ADAccount -LockedOut to it to clear several. You need delegated rights or membership in a group like Account Operators. Always confirm the source of the lockout before unlocking a repeatedly-locking account.

What controls how easily accounts lock out?

The account lockout policy — threshold, duration, and reset counter — set in a Group Policy object, usually the Default Domain Policy. A very low threshold causes nuisance lockouts; a very high one weakens defense against password guessing. A threshold around 10 attempts is a common balance.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.