Event 4625 Logon Failure: A Read-First Sub Status, Logon Type, Source, and Process Triage
Helpdesk: "The security log on the file server has hundreds of Event 4625 entries since last night. Is someone attacking us, or is it one stuck service? Should we lock the account and block the IP?" Maybe, but a 4625 on
Helpdesk: "The security log on the file server has hundreds of Event 4625 entries since last night. Is someone attacking us, or is it one stuck service? Should we lock the account and block the IP?"
Maybe, but a 4625 on its own does not say which. Event 4625 is the record that a logon attempt failed, and the answer is in four fields: Status/Sub Status, Logon Type, Source Network Address, and Caller Process Name. Microsoft's reference says it is logged "for any logon failure" and is generated on the computer where the attempt was made, so the event on a file server tells you about attempts against that server, not about the domain.
This post is a read-first order: pull the events, group them by the fields that matter, decode the Sub Status, then change one thing. It is a sibling of the Event 4771 Kerberos pre-authentication failed decoder (the domain controller's view) and the account keeps getting locked out triage.
TL;DR
- 4625 is logged on the machine where the logon was attempted. Microsoft: it "generates on domain controllers, member servers, and workstations."
-
Read Sub Status before Status. Status is often the generic
0xC000006D(bad user name or authentication information); the Sub Status carries the specific reason. - Logon Type tells you the door. 2 is interactive, 3 is network, 4 is batch, 5 is service, 7 is unlock, 10 is Remote Desktop, 11 is cached.
- Group by account, source address, and process before deciding anything. One account from one workstation is a stale credential; many accounts from one address is a different story.
- Do not block or lock anything from a single event. Identify the source first.
Step 1: Pull the events (read-only)
Run this on the server that logged the events, in an elevated PowerShell. It reads the Security log and pulls the fields from the event data by name, so it does not depend on the message text.
$events = Get-WinEvent -FilterHashtable @{ LogName='Security'; Id=4625; StartTime=(Get-Date).AddHours(-24) } -ErrorAction SilentlyContinue
$rows = foreach ($e in $events) {
$x = [xml]$e.ToXml()
$d = @{}
foreach ($n in $x.Event.EventData.Data) { $d[$n.Name] = $n.'#text' }
[pscustomobject]@{
Time = $e.TimeCreated
Account = "$($d.TargetDomainName)\$($d.TargetUserName)"
LogonType = $d.LogonType
Status = $d.Status
SubStatus = $d.SubStatus
Source = $d.IpAddress
Workstn = $d.WorkstationName
Process = $d.ProcessName
Package = $d.AuthenticationPackageName
}
}
"{0} events in 24h" -f @($rows).Count
If the count is zero, the machine is not auditing logon failures. Microsoft lists the subcategories as Audit Account Lockout and Audit Logon; check the policy before assuming nothing is failing.
Step 2: Group by the fields that matter (read-only)
Three groupings answer most of the question. Run them against $rows from Step 1.
$rows | Group-Object Account | Sort-Object Count -Descending | Select-Object -First 10 Count, Name
$rows | Group-Object Source | Sort-Object Count -Descending | Select-Object -First 10 Count, Name
$rows | Group-Object LogonType, SubStatus | Sort-Object Count -Descending | Format-Table Count, Name -AutoSize
How to read the result:
| Pattern | What it usually means | Next step |
|---|---|---|
| One account, one source, one process, steady rate | A stale saved password, a mapped drive, or a scheduled task | Find the process on the source machine (Step 5) |
| One account, many sources | The account name is being used from several places, such as a mobile device and a laptop | Check where that account is signed in |
| Many accounts, one source address | One host is trying several names | Identify the host before touching the account |
| Many accounts, many sources, logon type 3 or 10 | Something is trying names against an exposed service | Review what is reachable from outside, then escalate to security |
Sub Status 0xC0000064 for names that are not yours |
Attempts against user names that do not exist here | Check exposure; do not "fix" an account |
Step 3: Decode Status and Sub Status
Microsoft's field description says Status is "the reason why logon failed" and Sub Status is "additional information about logon failure," and it points to the NTSTATUS value list. These are the values you will see most often, with the meaning from that list:
| Sub Status | Name | Meaning |
|---|---|---|
0xC000006D |
STATUS_LOGON_FAILURE | Bad user name or authentication information (usually in Status; read Sub Status next) |
0xC0000064 |
STATUS_NO_SUCH_USER | The specified account does not exist |
0xC000006A |
STATUS_WRONG_PASSWORD | The current password provided is not correct |
0xC0000234 |
STATUS_ACCOUNT_LOCKED_OUT | Locked automatically after too many invalid attempts |
0xC0000072 |
STATUS_ACCOUNT_DISABLED | The account is disabled |
0xC000006F |
STATUS_INVALID_LOGON_HOURS | Time restrictions apply at this time |
0xC0000070 |
STATUS_INVALID_WORKSTATION | The account is restricted from this source workstation |
0xC0000071 |
STATUS_PASSWORD_EXPIRED | The password has expired |
0xC0000193 |
STATUS_ACCOUNT_EXPIRED | The account has expired |
0xC0000224 |
STATUS_PASSWORD_MUST_CHANGE | The password must be changed before logging on |
0xC000015B |
STATUS_LOGON_TYPE_NOT_GRANTED | The logon type has not been granted to this account here |
0xC000006E |
STATUS_ACCOUNT_RESTRICTION | Credentials valid, but an account restriction blocked the logon |
The pair that matters most in practice: 0xC0000064 means the name is wrong; 0xC000006A means the name exists and the password is wrong. Those two lead to different conversations. Microsoft's own sample for this event shows Status 0xC0000234 with the reason "Account locked out," which is the lockout case.
Step 4: Read the Logon Type
Microsoft's logon type table gives the door the attempt came through:
| Type | Title | Where to look |
|---|---|---|
| 2 | Interactive | Someone at the console, or a local service using a user logon |
| 3 | Network | File shares, mapped drives and remote management |
| 4 | Batch | Scheduled tasks and batch processes running as a user |
| 5 | Service | A service started by the Service Control Manager with a stored account password |
| 7 | Unlock | A workstation unlock with a wrong password |
| 10 | RemoteInteractive | Remote Desktop / Terminal Services |
| 11 | CachedInteractive | Logon with locally cached credentials |
Two quick rules from this table. A steady stream of type 4 or 5 for one account is almost always a task or service holding an old password. Type 10 with many different account names is a Remote Desktop exposure question, not a password reset question.
If the failures are type 5, the companion Service Control Manager events 7023, 7031, and 7034 post covers the service-side checks.
Step 5: Find the process and the source
The Process Information fields tell you what asked for the logon. Microsoft notes that the process ID is hexadecimal and can be compared to Task Manager's PID after converting to decimal.
$rows | Group-Object Process | Sort-Object Count -Descending | Select-Object -First 10 Count, Name
# Convert a logged hex PID to decimal (example value)
[Convert]::ToInt32('0x1bc', 16)
Then, on the source machine named in Source or Workstn, look for the stored credential: the process that matches, scheduled tasks and services running as the account, mapped drives, and saved credentials. Microsoft's monitoring recommendations for this event suggest watching for a Process Name outside the standard folders (not in System32 or Program Files) and for logon types that do not match the account, such as batch or service logons using a member of a domain admin group. Treat both as worth a closer look.
Step 6: Correlate with the other side (read-only)
The Logon ID in a 4625 can be matched with other events from the same session. For domain accounts, the domain controller records its own view; see the 4771 decoder for the Kerberos failure codes, and the lockout triage for finding the lockout source. If the Authentication Package is NTLM, the Package Name field tells you which NTLM version the client used, which helps spot old clients.
Change one thing
Once the pattern is clear, change exactly one thing and re-run Step 1 an hour later to compare the counts:
- Stale credential on one source: update the task, service, or saved credential on that machine.
- Wrong Sub Status for a real user: fix the specific condition (expired, disabled, logon hours, workstation restriction), not the password.
- Names that do not exist, from outside: reduce exposure (firewall or VPN in front of the service) and tell your security contact; do not change accounts.
-
Type 3 or 10 not granted (
0xC000015B): review the user rights assignment for that logon type with the account owner before granting anything.
Common false starts
- "Reset the password." If a task holds the old one, the lockout comes back in minutes.
- "Block the IP." Confirm it is not an internal host or a legitimate service first.
-
"Status
0xC000006Dis the reason." It is the generic code; the Sub Status is the reason. - "This is a domain problem." The event is local to the machine that was contacted; check each server's own log.
- "Turn auditing off to stop the noise." You lose the evidence. Filter it instead.
Related posts
- Event 4771 Kerberos pre-authentication failed (the domain controller's view of a failed Kerberos logon)
- Active Directory account keeps getting locked out (finding the lockout source)
- Service Control Manager events 7023, 7031, and 7034 (services failing to log on)
Free checklist
A failed logon is access policy telling you something, and the same habit applies before you enforce new policy. The free Conditional Access pre-enforcement checklist keeps break-glass accounts, pilot groups, and report-only review on one page:
If you want the rest of the Intune runway written down for the team (enrollment hygiene, compliance phasing, break/fix cards and read-only PowerShell snapshots), the Intune & M365 Admin Starter Pack pairs with this triage: https://cashflow4375.gumroad.com/l/joonf?utm_source=devto&utm_medium=article&utm_campaign=aps_first_sale&utm_content=event-4625-logon-failure
Sources: Microsoft Learn, "4625(F): An account failed to log on" (Windows security auditing reference); "4624(S): An account was successfully logged on"; NTSTATUS values list (MS-ERREF). Commands are read-only unless a step says to change something. Test in a lab first.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.