Entra IDDeep dive

Windows logon failure codes: event 4625 and 4776 status codes and account lockout 4740

The status and sub-status codes in events 4625 and 4776, from 0xC000006D to 0xC0000234, what each one means, and how to trace an account lockout (event 4740) back to its source.

Event 4625 says a logon failed, 4776 says a domain controller rejected NTLM credentials, and 4740 says the account is now locked out. The hex status codes in those events tell you why, and a few fields tell you where the attempt came from. This quick reference decodes the codes Microsoft documents for these events and then walks through tracing a lockout back to the device or service that still holds an old password.

Codes in this quick reference

  • 0xC000006D: logon failure, bad user name or authentication information (read the Sub Status)Security log (4625 / 4776)
  • Failure Reason: Unknown user name or bad password.Security log (event 4625)
  • 0xC000006A: user name is correct but the password is wrongSecurity log (4625 / 4776)
  • 0xC0000064: the user name doesn't existSecurity log (4625 / 4776)
  • 0xC0000234: account locked outSecurity log (4625 / 4776)
  • The referenced account is currently locked out and may not be logged on to.Windows sign-in screen
  • 0xC0000072: account disabled by administratorSecurity log (4625 / 4776)
  • 0xC0000193: account expiredSecurity log (4625 / 4776)

+ 13 more codes in the tables below.

How this guide is organized: How to read these codes → Bad user name or password → Account state and restrictions → Domain controller, time and trust problems → Trace an account lockout to its source → How to verify a fixFlow diagram of the article's sections in reading order: 1. How to read these codes. 2. Bad user name or password. 3. Account state and restrictions. 4. Domain controller, time and trust problems. 5. Trace an account lockout to its source (5 steps: Read 4740 on the PDC emulator; Compare the account on every DC; Go to the caller computer; No caller name? Turn on Netlogon logging; Fix the source, then unlock). 6. How to verify a fix. Toolbox: 0xC000006A, 0xC000006D, 0xC0000064, Get-ADUser, gpresult /h.1How to read these codes2Bad user name or password3Account state and restrictions4Domain controller, time andtrust problems5Trace an account lockout to itssource6How to verify a fix1Read 4740 on thePDC emulator2Compare theaccount on every…3Go to the callercomputer4No caller name?Turn on Netlogon l…5Fix the source, thenunlockTOOLBOX0xC000006A0xC000006D0xC0000064Get-ADUsergpresult /hHow this guide is organized: How to read these codes → Bad user name or password → Account state and restrictions → Domain controller, time and trust problems → Trace an account lockout to its source → How to verify a fixFlow diagram of the article's sections in reading order: 1. How to read these codes. 2. Bad user name or password. 3. Account state and restrictions. 4. Domain controller, time and trust problems. 5. Trace an account lockout to its source (5 steps: Read 4740 on the PDC emulator; Compare the account on every DC; Go to the caller computer; No caller name? Turn on Netlogon logging; Fix the source, then unlock). 6. How to verify a fix. Toolbox: 0xC000006A, 0xC000006D, 0xC0000064, Get-ADUser, gpresult /h.1How to read these codes2Bad user name or password3Account state and restrictions4Domain controller, time and trust problems5Trace an account lockout to its source1Read 4740 on the PDC emulator2Compare the account on every DC3Go to the caller computer4No caller name? Turn on Netlogon logging5Fix the source, then unlock6How to verify a fixTOOLBOX0xC000006A0xC000006D0xC0000064Get-ADUsergpresult /h
At a glance: how this guide is organized · 5 steps · 5 key settings and tools

How to read these codes#

Which logon failure event you have and what to read in itWhich event recorded the failure? if 4625: Is the Status 0xC000006D? if Yes: Read the Sub Status for the real reason (0xC000006A: the password is wrong; 0xC0000064: the user name doesn't exist); if No: Decode the Status, then check Logon Type (The Logon Type points to what made the attempt, such as 5 for a service); if 4776: Read Error Code and Source Workstation (NTLM only, logged by the computer that owns the account; no target server); if 4740: Trace the lockout from the PDC emulator (Caller Computer Name is the computer whose attempt triggered the lockout)Which event recorded thefailure?Is the Status 0xC000006D?FIXRead the Sub Status forthe real reason0xC000006A: thepassword is wrong;0xC0000064: the username doesn't existYesFIXDecode the Status,then check Logon TypeThe Logon Type points towhat made the attempt,such as 5 for a serviceNo4625FIXRead Error Code andSource WorkstationNTLM only, logged by thecomputer that owns theaccount; no target server4776FIXTrace the lockout fromthe PDC emulatorCaller Computer Name isthe computer whoseattempt triggered thelockout4740Which logon failure event you have and what to read in itWhich event recorded the failure? if 4625: Is the Status 0xC000006D? if Yes: Read the Sub Status for the real reason (0xC000006A: the password is wrong; 0xC0000064: the user name doesn't exist); if No: Decode the Status, then check Logon Type (The Logon Type points to what made the attempt, such as 5 for a service); if 4776: Read Error Code and Source Workstation (NTLM only, logged by the computer that owns the account; no target server); if 4740: Trace the lockout from the PDC emulator (Caller Computer Name is the computer whose attempt triggered the lockout)Which event recorded the failure?4625Is the Status 0xC000006D?YesFIXRead the Sub Status for the real reason0xC000006A: the password is wrong;0xC0000064: the user name doesn't existNoFIXDecode the Status, then check LogonTypeThe Logon Type points to what made theattempt, such as 5 for a service4776FIXRead Error Code and Source WorkstationNTLM only, logged by the computer that owns theaccount; no target server4740FIXTrace the lockout from the PDC emulatorCaller Computer Name is the computer whoseattempt triggered the lockout
Figure 1 · Decision tree Which logon failure event you have and what to read in it. Start from the event ID; the outcome names the fields that explain the failure, then decode the code in the tables below.
EventLogged onWhat to read
4625 An account failed to log on.The computer where the logon was attempted: workstation, member server or DC (Audit Logon, Audit Account Lockout)Status and Sub Status, Failure Reason, Logon Type, Caller Process Name, Workstation Name, Source Network Address
4776 The computer attempted to validate the credentials for an account.The computer that owns the account: the DC for domain accounts, the local computer for local accounts (Audit Credential Validation, NTLM only)Error Code and Source Workstation, the computer the attempt came from (the target server isn't shown)
4771 Kerberos pre-authentication failed.Domain controllersFailure Code 0x18 is a wrong password over Kerberos; Client Address is the sender. See Kerberos error codes
4740 A user account was locked out.DCs (including the PDC emulator), member servers and workstations (Audit User Account Management)Caller Computer Name: the computer whose logon attempt triggered the lockout

When Status is 0xC000006D, the Sub Status holds the real reason. The Logon Type points to what made the attempt:

Logon TypeUsually means
2 Interactive / 7 Unlock / 11 CachedInteractiveSomeone at the keyboard, unlocking a session, or a logon with cached credentials
3 NetworkA share, mapped drive or network application; check Source Network Address
4 Batch / 5 ServiceA scheduled task or a service running with stored credentials
8 NetworkCleartextAn application passed the password to Windows in unhashed form
9 NewCredentials / 10 RemoteInteractiverunas-style alternate credentials / Remote Desktop

Bad user name or password#

CodeMeaningUsual causeFirst check
0xC000006DGeneric logon failure: bad user name or authentication information. Failure Reason Unknown user name or bad password.The Sub Status says which: 0xC000006A or 0xC0000064. In 4776 it can also be a LAN Manager authentication level mismatch between source and targetSub Status, then Logon Type and Source Network Address
0xC000006AUser name is correct, password is wrongA typo, or a device, service, task or session still using an old password. Counts toward lockoutWorkstation Name, Source Network Address, Caller Process Name
0xC0000064The user name doesn't existTypo, deleted or renamed account, wrong domain. A run of these can be account enumerationThe name as typed and where it came from
0xC0000234Account locked out (Failure Reason Account locked out); users see The referenced account is currently locked out and may not be logged on to.Too many bad passwords reached the lockout thresholdFind the source (below) before you unlock

Account state and restrictions#

CodeMeaningUsual causeFirst check
0xC0000072Account disabled by an administratorAn offboarded user or retired service account that something still usesGet-ADUser name -Properties Enabled, then find what still uses it
0xC0000193Account expiredThe account's expiration date has passedAccountExpirationDate on the account
0xC0000071Password expiredPassword older than the maximum password ageChange it; for service accounts, update every stored copy
0xC0000224User must change password at next logonThe flag is set; network and service logons can't prompt for a new passwordChange it interactively, or clear the flag
0xC000006EAccount restriction (STATUS_ACCOUNT_RESTRICTION)The credentials are valid but a restriction, such as time of day, blocks the logonThe Sub Status names the restriction
0xC000006FLogon outside authorized hoursLogon hours set on the accountThe account's Logon Hours
0xC0000070Logon from an unauthorized workstationThe account's Log On To list doesn't include this computerThe Log On To list
0xC000015BNot granted the requested logon type (logon right) on this machineUser Rights Assignment, for example a missing "Allow log on through Remote Desktop Services" or an applied "Deny log on" rightgpresult /h report.html on that machine
0xC0000413The machine is protected by an authentication firewall; the account isn't allowed to authenticate to itA trust with selective authentication, and the account lacks "Allowed to authenticate" on the computer objectThat permission on the target computer

Domain controller, time and trust problems#

CodeMeaningUsual causeFirst check
0xC000005EThere are currently no logon servers available to service the logon requestThe computer can't find or reach a DC: DNS, network, sites or DC outage. An availability problem, not usually a security onenltest /dsgetdc:contoso.com on the computer
0xC0000192Logon attempted, but the Netlogon service wasn't startedNetlogon stopped or disabledGet-Service Netlogon
0xC0000133Time difference with the DC too large (STATUS_TIME_DIFFERENCE_AT_DC)The computer's clock has drifted too far from the domain controller'sw32tm /query /source, then w32tm /resync
0xC000018CTrust between the primary domain and the trusted domain failed (STATUS_TRUSTED_DOMAIN_FAILURE)A broken or unreachable domain trustnltest /sc_verify:fabrikam.com on a DC of the trusting domain
0xC000018DThe trust relationship between this workstation and the primary domain failed.The computer's password no longer matches its AD account, for example after restoring an old snapshot or when another computer uses the same name; Netlogon event 3210 in the System logTest-ComputerSecureChannel -Verbose; repair with -Repair -Credential (Get-Credential)
0xC0000371The local account store doesn't contain secret material for the account (4776)Microsoft's table gives no further detailWhich account and Source Workstation are involved

Microsoft's broken trust relationship guide covers recurring secure channel failures, and Domain trust failures after KB5124008 covers the 2026 Windows 11 case. Any other code is an NTSTATUS value: look it up in Microsoft's NTSTATUS values list.

Trace an account lockout to its source#

1. Read 4740 on the PDC emulator#

The PDC emulator sees the lockout, so start there. In the event XML, the Caller Computer Name is stored in the TargetDomainName field:

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

2. Compare the account on every DC#

badPwdCount and the last bad password time are kept separately on each DC and aren't replicated. Besides the PDC emulator, which also records forwarded attempts, the DCs showing recent bad attempts tell you which site the bad password came through:

PowerShell
Get-ADDomainController -Filter * | ForEach-Object {
    $dc = $_.HostName
    Get-ADUser alex -Server $dc -Properties LockedOut, badPwdCount, LastBadPasswordAttempt |
        Select-Object @{n='DC'; e={$dc}}, LockedOut, badPwdCount, LastBadPasswordAttempt
}

3. Go to the caller computer#

On the computer named in 4740, read the 4625 events for that account. Logon Type 4 or 5 points to a scheduled task or service, 3 to a network client (follow the Source Network Address), 10 to a Remote Desktop session. If the caller is a server that authenticates on behalf of users, such as a mail, web, AD FS or VPN server, the stale password lives on a device behind it, so check that server's own logs.

4. No caller name? Turn on Netlogon logging#

For NTLM attempts, 4776 on the DCs shows the Source Workstation; for Kerberos, 4771 with 0x18 shows the Client Address. When neither is enough, enable Netlogon debug logging on the DCs (or deploy the Computer Configuration › Administrative Templates › System › Net Logon › Specify log file debug output level policy), reproduce, and search the log for the user and 0xC000006A or 0xC0000234:

Command Prompt
nltest /dbflag:0x2080ffff
:: reproduce, then read %windir%\debug\netlogon.log
nltest /dbflag:0x0

5. Fix the source, then unlock#

Update or remove the stale credential: a service or scheduled task, saved credentials in Credential Manager, a persistent mapped drive, a phone's mail profile, a script, or a disconnected Remote Desktop session. Only then unlock:

PowerShell
Search-ADAccount -LockedOut | Select-Object SamAccountName, LastLogonDate
Unlock-ADAccount -Identity alex

Unlocking before the source is fixed just starts the next lockout. With pass-through authentication, cloud sign-ins count against the AD threshold too; AADSTS50053 and on-premises lockouts explains how the two policies interact.

How to verify a fix#

  1. No new 4740 for the account on the PDC emulator through at least one full cycle of whatever caused it: a daily task needs a day, not five minutes.
  2. badPwdCount stays at 0 on every DC, and the 4625 or 4776 failures from the old source stop.
  3. The user signs in, and 4624 (successful logon) appears where 4625 used to.
  4. Netlogon logging is back to 0x0 on every DC where you enabled it.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

M365 Subject Matter Expert, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)