DEV Community

AdminPackStudio
AdminPackStudio

Posted on

Event 4771 Kerberos Pre-Authentication Failed: A Failure Code Decoder for 0x18, 0x12, 0x25, and 0x10

Helpdesk: "The SIEM flagged about 340 Event 4771 'Kerberos pre-authentication failed' on DC02 overnight. Most are svc-backup with Failure Code 0x18 and Pre-Authentication Type 2, a few are jlee with 0x12, and APP07$ has a run of 0x25. Someone says to tick 'Do not require Kerberos preauthentication' on svc-backup so the alerts stop, and someone else wants to turn off Kerberos auditing on the DCs because the volume is too high. Can we?"

Not yet. Event 4771 isn't one problem. It's the domain controller telling you it refused to hand out a ticket-granting ticket, and the Failure Code says why. Microsoft's reference for the event says "This event generates every time the Key Distribution Center fails to issue a Kerberos Ticket Granting Ticket (TGT)." and "This event generates only on domain controllers." So the useful questions are in the event itself: which DC logged it, for which account (a user, a service account, or a computer account ending in $), with which Failure Code, which Pre-Authentication Type, from which Client Address and port, and how many in how long. 0x18 is a wrong password, 0x12 is an account the KDC won't issue for (disabled, expired, or locked out), 0x25 is a clock problem, 0x10 is a smart card or domain controller certificate problem, and each one sends you to a different place. Ticking the no-preauthentication box doesn't fix any of them; Microsoft's 4771 page says the event isn't generated for accounts that have that option set, so it only hides the evidence and weakens the account. Turning off the audit subcategory hides it on every account at once. Work through it as a chain: which DC, which account, when, how many? → is the audit policy actually on, on every DC? → what do the fields say (Account Name, Service Name, Client Address, Client Port, Ticket Options)? → what does the Failure Code mean? → what does the Pre-Authentication Type say about how the client tried? → which machine is behind the Client Address? → check the one thing that code points at (password, account state, clock, certificate, encryption type) → change one link → prove the 4771s stop for that account and address. Get-WinEvent against each DC's Security log, auditpol /get, Get-ADUser and Search-ADAccount against the PDC emulator, Resolve-DnsName, w32tm, certutil -DCInfo, and Test-ComputerSecureChannel are the sources for that chain. Disable pre-authentication or auditing and you've traded a decodable event for a blind spot (our reading).

If the 4771s are for one user who keeps getting locked out, Active Directory Account Keeps Getting Locked Out covers the hunt from Event 4740 on the PDC emulator to the service, task, or saved credential that's still using the old password; this post decodes the 4771 and hands off there. If the code is 0x25, Windows Time Not Syncing With Domain Controller covers the time hierarchy. If the account is a computer account and the machine also says the trust relationship failed, The Trust Relationship Between This Workstation and the Primary Domain Failed covers the secure channel. This post covers "Event 4771 Kerberos pre-authentication failed on a Windows Server 2016, 2019, 2022, or 2025 domain controller, with Failure Code 0x18, 0x12, 0x17, 0x25, 0x10, or 0xE, for a user, service, or computer account, and you need to know what the code, the Pre-Authentication Type, and the Client Address mean before you unlock, reset, disable pre-authentication, change the clock tolerance, or turn auditing off."

TL;DR

  • Read the Failure Code first; it decides everything else. Microsoft's 4771 table, which follows RFC 4120, gives 0x18 as "The wrong password was provided." and 0x17 as "The user's password has expired." (Step 4).
  • 0x12 is account state, not a password. Microsoft's 4768 page says KDC_ERR_CLIENT_REVOKED "might be because of an explicit disabling or because of other restrictions in place on the account. For example: account disabled, expired, or locked out." (Steps 4 and 8).
  • 0x25 is the clock. Microsoft's Kerberos guide: "The difference in time between the domain controller and the client computer or the target server must be less than five minutes." Measure it from the Client Address machine before touching the policy (Step 9).
  • 0x10 is smart card or the DC certificate. Microsoft: "Smart card logon is being attempted and the proper certificate cannot be located." Pair it with a Pre-Authentication Type of 15 or 16 (Steps 5 and 10).
  • Pre-Authentication Type 2 is a password. Microsoft: "This type is normal for standard password authentication." So 0x18 with type 2 is someone or something typing or replaying a wrong password (Step 5).
  • The Client Address is the machine, not the user. Microsoft: "IP address of the computer from which the TGT request was received." Resolve it, then follow the account on that machine (Step 6, then the lockout post for the hunt).

Where in the chain did it break?

Step What should be true Typical symptom when it breaks
1. Symptom captured Which DC, which account, which code, which address, how many, since when "Lots of Kerberos errors on the DCs" with no account, code, or address written down
2. Audit and coverage Kerberos Authentication Service failure auditing is on for every DC, and every DC's log is read One DC read, the failures went to the other three
3. Fields read Account Name, Service Name, Client Address, Client Port, Ticket Options, Failure Code, and Pre-Authentication Type are pulled out per event The rendered message skimmed and the Failure Code missed
4. Code decoded Each Failure Code is mapped to Microsoft's name and description 0x12 treated as a wrong password, or 0x25 treated as an attack
5. Pre-auth type decoded The type tells you password, smart card, or armoring A smart card failure chased as a password problem
6. Client found The Client Address is resolved to a machine and an owner An IP written on the ticket and nobody looking at the machine behind it
7 to 11. The one check Password and credential (0x18), account state (0x12, 0x17), clock (0x25), certificate (0x10), or encryption type (0xE) The same reset or unlock applied to every code
12. Change One link fixed on the account, the machine, or the DC that needs it Pre-auth disabled, auditing off, or the clock tolerance raised domain-wide
13. Proof The 4771s for that account and address stop, on every DC, for a full business day Quiet on one DC for an hour, still failing on the others

Step 1: Capture the symptom (read-only)

Write these on the ticket first:

Fact Why it matters
The DC that logged it 4771 is written by the DC that answered the request. Clients use whichever DC the locator gave them, so one account's failures can be spread across several DCs (our reading)
Account Name, and whether it ends in $ Microsoft: "Computer account name ends with $ character." A computer account failing is a different problem from a user failing
Failure Code The reason; Step 4 decodes it
Pre-Authentication Type How the client tried: password, smart card, or armoring; Step 5 decodes it
Client Address and Client Port The machine that sent the request, and a port that can look odd; Step 6
How many, over how long, and since when One a day is a typo; hundreds an hour is a stale credential, a spray, or a broken service (our reading)
What changed A password change, a disabled or expired account, a new smart card or DC certificate, a time source change, a VM restore, a new baseline
Whether anyone is actually locked out If yes, the 4740 hunt in the lockout post linked above runs alongside this

Then branch on what you see:

What you see What it usually means (our reading unless noted) Start at
0x18, Pre-Authentication Type 2, one account, one Client Address, steady rate Something on that machine is using an old password for that account Steps 6 and 7, then the lockout post
0x18, one account, many Client Addresses The password changed and several devices still have the old one, or the account is being guessed from many places Steps 6 and 7
0x18 for many accounts from one Client Address Microsoft's monitoring note: a burst can "indicate a brute-force attack on the account password, especially for highly critical accounts." Step 7, and your security team
0x12 The account is disabled, expired, or locked out; read its state Step 8
0x17 Microsoft: "The user's password has expired." Step 8
0x25 The client's clock is too far from the DC's Step 9
0x10 with type 15 or 16 Smart card logon and the DC's certificate Step 10
0xE An encryption type the KDC or the account doesn't support Step 11
The account ends in $ A computer account: its machine password, its clock, or its secure channel Steps 7 and 9
You expected 4771s and the DC has none The audit subcategory is off, the account doesn't require pre-authentication, or you're reading the wrong DC Step 2

Step 2: Make sure you're seeing all of it (read-only)

4771 lives in the Security log of domain controllers only, under one audit subcategory. Microsoft's page for that subcategory says "This subcategory makes sense only on domain controllers." and warns "Expected volume is high on domain controllers." Check that failure auditing is on, on every DC, before you trust a count:

# Read-only, on each DC: is failure auditing on for the subcategory that writes 4768 and 4771?
auditpol /get /subcategory:"Kerberos Authentication Service"

# Read-only: list the DCs, then count 4771 per DC for the last 24 hours
$since = (Get-Date).AddHours(-24)
$dcs = Get-ADDomainController -Filter * | Select-Object -ExpandProperty HostName
foreach ($dc in $dcs) {
  $n = (Get-WinEvent -ComputerName $dc -FilterHashtable @{ LogName='Security'; Id=4771; StartTime=$since } -ErrorAction SilentlyContinue | Measure-Object).Count
  [pscustomobject]@{ DC = $dc; Events4771 = $n }
}
Enter fullscreen mode Exit fullscreen mode

Get-WinEvent -ComputerName takes one name at a time; Microsoft's reference says "This parameter accepts only one computer name at a time." That's why the loop. auditpol /get with a subcategory name in quotes is Microsoft's documented form; the output should say Failure (or Success and Failure) for Kerberos Authentication Service on every DC. Then check the other places a failed sign-in can land, so you know which event to expect where:

Event Where Microsoft says it's written What it adds to a 4771
4771 Kerberos pre-authentication failed "This event generates only on domain controllers." The Failure Code, Pre-Authentication Type, and Client Address
4768 A Kerberos authentication ticket (TGT) was requested Domain controllers; the 4768 page says "This event doesn't generate for Result Codes: 0x10 and 0x18." because 4771 is logged instead Successes, and failures with other codes (0x6, 0xC, 0x12, 0xE) under Result Code
4772 A Kerberos authentication ticket request failed Microsoft: "Currently this event doesn't generate." and "4768 failure event is generated instead." Nothing; don't build an alert on it
4776 NTLM credential validation Microsoft: "This event occurs only on the computer that is authoritative for the provided credentials." For domain accounts that's a DC The same account failing over NTLM instead of Kerberos, with a Source Workstation name
4625 An account failed to log on Microsoft: "It generates on the computer where logon attempt was made" The Logon Type and Caller Process Name on the machine behind the Client Address
4740 A user account was locked out DCs, member servers, and workstations, per Microsoft's page The lock itself and the Caller Computer Name; the lockout post covers it

If one account's 4771s show up on DC02 but not DC01, that's normal: the client asked DC02. If a DC shows none at all while the others show hundreds, read its audit policy before deciding it's healthy (our reading).


Step 3: Pull the fields out of each event (read-only)

The rendered message is fine for one event and useless for three hundred. Every field you need is named in the event's XML, and Microsoft's sample shows the names: TargetUserName, TargetSid, ServiceName, TicketOptions, Status, PreAuthType, IpAddress, IpPort, and three certificate fields. Turn each event into one row:

# Read-only, against one DC: last 24 hours of 4771 as rows, one column per named field
$dc    = 'DC02.contoso.com'
$since = (Get-Date).AddHours(-24)
$rows = Get-WinEvent -ComputerName $dc -FilterHashtable @{ LogName='Security'; Id=4771; StartTime=$since } -ErrorAction SilentlyContinue |
  ForEach-Object {
    $x = [xml]$_.ToXml()
    $d = @{}
    foreach ($f in $x.Event.EventData.Data) { $d[$f.Name] = $f.'#text' }
    [pscustomobject]@{
      Time          = $_.TimeCreated
      DC            = $dc
      Account       = $d['TargetUserName']
      Service       = $d['ServiceName']
      FailureCode   = $d['Status']
      PreAuthType   = $d['PreAuthType']
      ClientAddress = $d['IpAddress']
      ClientPort    = $d['IpPort']
      TicketOptions = $d['TicketOptions']
    }
  }
$rows | Sort-Object -Property Time | Format-Table -AutoSize
Enter fullscreen mode Exit fullscreen mode

ToXml() is the .NET method on each event record; Microsoft's reference says it "Gets the XML representation of the event." Then read each field the way Microsoft defines it:

Field (XML name) Microsoft's definition or values How to read it here (our reading unless noted)
Account Name (TargetUserName) "the name of account, for which (TGT) ticket was requested." and "Computer account name ends with $ character." A user, a service account, or a computer; a $ sends you to the machine's own password, clock, or secure channel
Service Name (ServiceName) Typically krbtgt/DOMAIN_NETBIOS_NAME or krbtgt/DOMAIN_FULL_NAME Always the KDC's own service for a TGT request; it doesn't name the app the user was trying to reach
Client Address (IpAddress) "IP address of the computer from which the TGT request was received." Formats: IPv6 or IPv4, ::ffff: plus an IPv4 address, or ::1 for localhost The machine to go and look at (Step 6)
Client Port (IpPort) "0 for local (localhost) requests." Usually a high ephemeral port; see the monitoring note below for low ports
Ticket Options (TicketOptions) Microsoft lists the most common values, starting with "0x40810010 - Forwardable, Renewable, Canonicalize, Renewable-ok" Rarely the cause of a 4771; an unusual value from one address is worth noting, not chasing first
Failure Code (Status) "hexadecimal failure code of failed TGT issue operation." The reason; Step 4
Pre-Authentication Type (PreAuthType) "the code of pre-Authentication type that was used in TGT request." How the client tried; Step 5
Certificate Issuer Name, Serial Number, Thumbprint Each one: "Always empty for 4771 events." Don't wait for them to name the smart card; they won't

Microsoft's monitoring section adds two Client Address and Client Port checks that are worth running on any big batch. On localhost: "All Client Address = ::1 means local authentication." On ports, it says 4771 events with a Client Port above 0 and below 1024 "should be examined, because a well-known port was used for outbound connection." A ::1 for an account that has no business signing in on a DC is a finding on its own (our reading).


Step 4: Decode the Failure Code (read-only)

Group the rows from Step 3 before you look at any one event. The groups usually tell the story faster than the events do:

# Read-only: how many of each code, per account and client address, busiest first
$rows | Group-Object -Property FailureCode, Account, ClientAddress -NoElement |
  Sort-Object -Property Count -Descending |
  Select-Object -First 25 -Property Count, Name |
  Format-Table -AutoSize
Enter fullscreen mode Exit fullscreen mode

Then map each code. The names and descriptions below are from Microsoft's 4771 table, which it says lists "the error codes for this event as defined in RFC 4120"; the possible causes are Microsoft's where quoted, from the 4771 page or the 4768 page:

Failure Code Name Microsoft's description and cause Read next
0x18 KDC_ERR_PREAUTH_FAILED "Pre-authentication information was invalid" and "The wrong password was provided." Who or what is sending a wrong password (Step 7)
0x17 KDC_ERR_KEY_EXPIRED "The user's password has expired." The account's password age and whether the device ever prompts for a change (Step 8)
0x12 KDC_ERR_CLIENT_REVOKED 4771: "Clients credentials have been revoked". 4768: "account disabled, expired, or locked out." The account's state on the PDC emulator (Step 8)
0x25 KRB_AP_ERR_SKEW 4771: "Clock skew too great". 4768: "This error is logged if a client computer sends a timestamp whose value differs from that of the server's timestamp by more than the number of minutes found in the" Kerberos policy's maximum tolerance setting The clock on the Client Address machine (Step 9)
0x10 KDC_ERR_PADATA_TYPE_NOSUPP "KDC has no support for PADATA type (pre-authentication data)" and "Smart card logon is being attempted and the proper certificate cannot be located." The DC's certificate and the smart card path (Step 10)
0xE KDC_ERR_ETYPE_NOSUPP "KDC has no support for encryption type". 4768: "In general, this error occurs when the KDC or a client receives a packet that it cannot decrypt." Encryption types on the account and the client (Step 11)

Three neighbours that people expect in 4771 and usually find elsewhere:

Code Where you'll usually see it Microsoft's text
0x6 KDC_ERR_C_PRINCIPAL_UNKNOWN 4768 failures, not 4771 (our reading of the two tables) "The username doesn't exist."
0xC KDC_ERR_POLICY 4768 failures "This error is usually the result of logon restrictions in place on a user's account. For example workstation restriction, smart card authentication requirement or logon time restriction."
0x19 KDC_ERR_PREAUTH_REQUIRED Network captures, as normal traffic Microsoft's Kerberos guide lists it among strings that "are part of typical Kerberos functions"

The 0x19 row matters if someone opens a capture next: the client's first request without pre-authentication data, answered by "Additional pre-authentication required", is how Kerberos normally starts, not a failure (our reading of Microsoft's list). The 0x12 row matters because Microsoft's 4771 table gives the name with no cause; the cause text comes from the 4768 page, whose table covers the same code. Read both before you decide what 0x12 means for your account (our reading).


Step 5: Decode the Pre-Authentication Type (read-only)

The Failure Code says why the KDC refused. The Pre-Authentication Type says what the client tried. Microsoft's table for the event:

Type Name Microsoft's description
0 - "Logon without Pre-Authentication."
2 PA-ENC-TIMESTAMP "This type is normal for standard password authentication."
15 PA-PK-AS-REP_OLD "Used for Smart Card logon authentication."
16 PA-PK-AS-REQ "Request sent to KDC in Smart Card authentication scenarios."
17 PA-PK-AS-REP Smart card; Microsoft notes it's never seen in certain Active Directory environments
11 and 19 PA-ETYPE-INFO and PA-ETYPE-INFO2 Sent by the KDC; Microsoft: "Never saw this Pre-Authentication Type in Microsoft Active Directory environment."
20 PA-SVR-REFERRAL-INFO "Used in KDC Referrals tickets."
138 PA-ENCRYPTED-CHALLENGE "Logon using Kerberos Armoring (FAST)."
- - "This type shows in Audit Failure events."

Read the pair, not either half alone (our reading unless noted):

Failure Code + type What it usually means Go to
0x18 + 2 A password was sent and it's wrong: a typo, an old password cached in a service or device, or guessing Step 7
0x18 + 138 The same wrong password, sent inside Kerberos armoring Step 7
0x17 + 2 The right password for an expired account; the device didn't or couldn't prompt for a change Step 8
0x10 + 15 or 16 Microsoft's sample event is exactly this pair; a smart card logon that couldn't complete because of the certificate side Step 10
0x12 or 0x25 + 2 The password may be fine; the account state or the clock stopped it first Steps 8 and 9
Any code + a type you don't use Microsoft's monitoring rows: "Value is not 15 when account must use a smart card for authentication." and "Value is not 2 when only standard password authentication is in use in the organization." Treat as unexpected and find the client (Step 6)

Two of Microsoft's monitoring notes belong on the ticket here. For 0x10: "This error can help you to more quickly identify smart-card related problems with Kerberos authentication." For 0x18 in bursts: "This issue can indicate a brute-force attack on the account password, especially for highly critical accounts."


Step 6: Find the machine behind the Client Address (read-only)

The Client Address is where the request came from. Turn it into a name, then go to that machine. Strip the ::ffff: prefix first, because the rest is an ordinary IPv4 address:

# Read-only: unique client addresses for one account and code, as plain IPv4 where possible
$hits = $rows | Where-Object { $_.Account -eq 'svc-backup' -and $_.FailureCode -eq '0x18' }
$ips  = $hits | ForEach-Object { $_.ClientAddress -replace '^::ffff:', '' } | Sort-Object -Unique
$ips

# Read-only: reverse lookup for each address
foreach ($ip in $ips) {
  Resolve-DnsName -Name $ip -Type PTR -ErrorAction SilentlyContinue |
    Select-Object -Property Name, NameHost
}
Enter fullscreen mode Exit fullscreen mode

Resolve-DnsName -Type PTR is the documented form; Microsoft's reference describes PTR as "the DNS query type is domain name pointer." Then read the result carefully:

What you get What it means (our reading unless noted) Next
A workstation or server name That machine sent the request; something on it holds the credential That machine's 4625 and the lockout post's source steps
::1 Microsoft: "All Client Address = ::1 means local authentication." The DC itself sent it, for a service or a sign-in on the DC The DC's own services, tasks, and sessions for that account
An Exchange, NPS, RD Gateway, web, or proxy server A relay: the server asked for a ticket on someone's behalf with the password it was given The relay's own logs; the lockout post covers relayed attempts
A VPN, NAT, or load balancer address Many clients behind one address The device's own logs for the same minute
No PTR record Reverse DNS doesn't exist for that range, or the address is outside your network DHCP leases or the network team; an outside address is a security finding

On the machine you found, the Security log shows the other side of the same attempt. Microsoft's 4625 page says it "generates on the computer where logon attempt was made", and that event has the Logon Type and the Caller Process Name that 4771 doesn't. Reading those, and then services, scheduled tasks, saved credentials, and mapped drives for the account, is the hunt the lockout post linked at the top walks through step by step, so it isn't repeated here.


Step 7: 0x18, a wrong password, and from where (read-only)

0x18 with Pre-Authentication Type 2 is the most common 4771 by far in most domains (our reading), and the pattern of accounts and addresses is what separates a typo from a stale credential from an attack:

Pattern in the Step 4 grouping What it usually means (our reading unless noted) Next
One account, one address, a steady rate (every few minutes, around the clock) A service, scheduled task, app pool, mapped drive, or phone on that machine still has the old password The lockout post's source steps on that machine
One account, one address, a handful during business hours A person mistyping, then getting it right Nothing, unless it locks
One account, several addresses, starting right after a password change Several devices with the old password Each address in turn (Step 6)
Many accounts, one address Microsoft's brute-force note above; a password spray from that machine or through that relay Your security team, with the rows from Step 3
A computer account ($) with 0x18 The machine's own account password and what the DC has stopped matching The machine's secure channel, below
A service account with 0x18 on every DC The service is running on more than one server, and each server is a separate address Every address, not only the first

For a computer account, check the secure channel from the machine itself. Test-ComputerSecureChannel without -Repair is a read; Microsoft's reference says it "verifies that the channel between the local computer and its domain is working correctly by checking the status of its trust relationships." and that it returns $true or $false:

# Read-only, on the machine behind the Client Address (for a computer account with 0x18)
Test-ComputerSecureChannel -Verbose
Enter fullscreen mode Exit fullscreen mode

If that returns $false, the trust relationship post linked at the top covers the repair; don't reset the computer account from a DC until you've read it (our reading).

For a user or service account, the counters live on the domain controllers and the PDC emulator has the latest picture. Microsoft's archived wiki on bad passwords says "Whenever a DC finds that a login attempt has a bad password, it immediately contacts the PDC Emulator to check if the password was recently changed." It also says badPwdCount and badPasswordTime are among the attributes that are not replicated, so read them on the PDC emulator and on the DC that logged the 4771:

# Read-only: bad password counters on the PDC emulator and on the DC that logged the 4771
$pdc = (Get-ADDomain).PDCEmulator
foreach ($s in @($pdc, 'DC02.contoso.com')) {
  Get-ADUser -Identity 'svc-backup' -Server $s -Properties badPwdCount, badPasswordTime |
    Select-Object -Property @{ n='DC'; e={ $s } }, SamAccountName, badPwdCount,
      @{ n='LastBadPassword'; e={ [datetime]::FromFileTime($_.badPasswordTime) } }
}
Enter fullscreen mode Exit fullscreen mode

badPasswordTime is a large integer counted in 100-nanosecond intervals since 1601 (UTC), per Microsoft's attribute page; [datetime]::FromFileTime "Converts the specified Windows file time to an equivalent local time." Don't expect the counter to match the number of 4771s. The same wiki says "Passwords that match one of the two most recent passwords in password history will not increment the badPwdCount." so a device sending last month's password can produce 0x18 events with a counter that barely moves (our reading of the wiki's tests). Whether the account locks is a policy question; the lockout post covers thresholds, fine-grained policies, and the 4740 hunt.


Step 8: 0x12 and 0x17, the account's state (read-only)

0x12 and 0x17 are about the account, not the password the client sent. Read the account on the PDC emulator, both through the search switches and through the attributes behind them:

# Read-only: is the account disabled, expired, locked out, or past its password age?
$pdc = (Get-ADDomain).PDCEmulator
$u   = 'jlee'
foreach ($check in 'AccountDisabled', 'AccountExpired', 'LockedOut', 'PasswordExpired') {
  $p = @{ UsersOnly = $true; Server = $pdc; $check = $true }
  $hit = Search-ADAccount @p | Where-Object { $_.SamAccountName -eq $u }
  [pscustomobject]@{ Check = $check; Hit = [bool]$hit }
}

# Read-only: the attributes behind those answers
Get-ADUser -Identity $u -Server $pdc -Properties userAccountControl, 'msDS-User-Account-Control-Computed', accountExpires, pwdLastSet, lockoutTime, logonHours, userWorkstations |
  Select-Object -Property SamAccountName, userAccountControl, 'msDS-User-Account-Control-Computed', accountExpires,
    @{ n='PwdLastSet'; e={ if ($_.pwdLastSet -eq 0) { 'must change at next logon' } else { [datetime]::FromFileTime($_.pwdLastSet) } } },
    @{ n='LockoutTime'; e={ if ($_.lockoutTime -eq 0) { 'not locked' } else { [datetime]::FromFileTime($_.lockoutTime) } } },
    userWorkstations |
  Format-List
Enter fullscreen mode Exit fullscreen mode

The four switches are Microsoft's: -AccountDisabled "Specifies a search for accounts that are disabled.", -AccountExpired "Specifies a search for accounts that are expired.", -LockedOut "Indicates that this cmdlet searches for accounts that are locked out.", and -PasswordExpired "Indicates that this cmdlet searches for accounts that have an expired password." Then read the attributes:

Attribute or flag Microsoft's definition Which code it explains (our reading unless noted)
userAccountControl ACCOUNTDISABLE (0x0002) "The user account is disabled." 0x12
msDS-User-Account-Control-Computed UF_LOCKOUT (0x0010) A computed bit; Microsoft says the attribute "can contain additional bits that are not persisted." 0x12
lockoutTime "A value of zero means that the account is not currently locked out." 0x12 if non-zero and still inside the lockout duration
accountExpires 0 or 0x7FFFFFFFFFFFFFFF "indicates that the account never expires"; otherwise a date in 100-nanosecond intervals since 1601 (UTC) 0x12 if the date has passed
msDS-User-Account-Control-Computed UF_PASSWORD_EXPIRED (0x800000) A computed bit, the current form of the old PASSWORD_EXPIRED flag 0x17
pwdLastSet "If this value is set to 0 and the User-Account-Control attribute does not contain the UF_DONT_EXPIRE_PASSWD flag, then the user must set the password at the next logon." 0x17 or a change-at-next-logon prompt the device never shows
logonHours "The hours that the user is allowed to logon to the domain." 0xC in 4768, per Microsoft's logon restriction text, more than 0x12
userWorkstations Microsoft: "This user attribute should not be used anymore." 0xC in 4768 if it's set

Microsoft's note on userAccountControl explains why the computed attribute matters: in a Windows Server 2003-based domain, the lockout and password-expired flags were replaced with the ms-DS-User-Account-Control-Computed attribute. Reading the old flags in userAccountControl can say "not locked" while the account is locked (our reading of that note).

What to do with the answer (our reading unless noted):

Finding Meaning for the 4771
Disabled Expected 0x12; find what still uses the account (Step 6) and retire it, or re-enable only if the account should be in use
Expired Expected 0x12; extend the expiry only if the owner confirms it's still needed
Locked out 0x12 now, after earlier 0x18s locked it; the source is in the 0x18 history and the lockout post
Password expired, or pwdLastSet 0 Expected 0x17; a service account or a device that can't show a change prompt will fail until someone sets a password
None of the above, still 0x12 Read the 4768 events for the same account and minute, and the account's other restrictions, before assuming a bug

Step 9: 0x25, the clock (read-only)

0x25 means the timestamp the client sent was too far from the DC's time. The limit is the Kerberos policy setting Maximum tolerance for computer clock synchronization; Microsoft's page for it says "It's advisable to set Maximum tolerance for computer clock synchronization to a value of 5 minutes." and lists 5 minutes as the Default Domain Policy value. Measure the offset from the machine behind the Client Address, against the DC that logged the event:

# Read-only, on the machine behind the Client Address: offset to the DC that logged the 0x25
w32tm /stripchart /computer:DC02.contoso.com /dataonly /samples:5

# Read-only: where this machine gets its time, and its current sync state
w32tm /query /source
w32tm /query /status
Enter fullscreen mode Exit fullscreen mode

/stripchart "Displays a strip chart of the offset between this computer and another computer."; /dataonly and /samples are from the same Microsoft reference. Then read it:

What you see What it means (our reading unless noted) Next
Offset of several minutes or more The client is outside the tolerance; that's the 0x25 Its time source
Source names the machine's own clock instead of a DC The machine isn't syncing from the domain hierarchy at all The time sync post linked at the top
Source is a VM host time provider or an outside NTP server A domain member using a source other than the domain Microsoft's second case below
Offset is small now The clock was fixed since, or it drifts and gets pulled back; compare the 0x25 times with the machine's time sync events The time sync post
The account is a computer account ($) The machine's own sign-in is failing on time; users on it may fail too Same as above

Microsoft's Kerberos troubleshooting guide names two cases where Windows won't fix the clock on its own: "The clocks are out of sync by more than 48 hours." and "The out-of-sync clock doesn't use a domain controller in its domain as a time server, or doesn't use the same time server as those domain controllers do." Its resync command for that is w32tm /resync /computer:<Target> /rediscover, which is a change, so it's in Step 12. Raising the tolerance instead treats the symptom on every machine in the domain to hide one bad clock (our reading); the same policy page says the 5 minute limit exists because Kerberos uses time stamps against replay attacks.


Step 10: 0x10, smart cards and the DC certificate (read-only)

0x10 with Pre-Authentication Type 15 or 16 is a smart card (or certificate-based) sign-in that failed on the KDC side. Microsoft's cause text for 0x10 says the wrong certification authority may be queried or can't be contacted, and "It can also happen when a domain controller doesn't have a certificate installed for smart cards (Domain Controller or Domain Controller Authentication templates)." Read the certificate on the DC that logged the event:

# Read-only, on the DC that logged the 0x10: machine certificates, their EKUs, and expiry
Get-ChildItem -Path Cert:\LocalMachine\My |
  Select-Object -Property Subject, NotAfter, Thumbprint, DnsNameList, EnhancedKeyUsageList |
  Format-List

# Read-only: the DC certificates as the domain sees them, with verification
certutil -DCInfo Verify
Enter fullscreen mode Exit fullscreen mode

Microsoft's certutil reference says -DCInfo "Displays information about the domain controller. The default displays DC certificates without verification." and lists Verify, DeleteBad, and DeleteAll as its modifiers. Use only Verify; going by their names, the other two remove certificates, so they aren't part of a read (our reading). The same page says the command needs an account that is a member of Domain Admins or Enterprise Admins. Then compare what you found with what Microsoft says a DC certificate needs:

Requirement Source What a miss looks like (our reading)
Enhanced key usage includes Client Authentication (1.3.6.1.5.5.7.3.2), Server Authentication (1.3.6.1.5.5.7.3.1), and KDC Authentication (1.3.6.1.5.2.3.5) Microsoft's Windows Hello for Business PKI page for domain controller certificates A web server or LDAPS certificate on the DC that was never a KDC certificate
A CRL distribution point that points to a valid CRL, and the DNS name in the Subject Alternative Name Microsoft's requirements for a domain controller certificate from a third-party CA certutil -DCInfo Verify failing on revocation or name
The certificate is in the local computer store Same page: "The domain controller certificate must be installed in the local computer's certificate store." Nothing in Cert:\LocalMachine\My with the KDC EKU
The current template Microsoft: "The Kerberos Authentication certificate template is the most current certificate template designated for domain controllers, and should be the one you deploy to all your domain controllers." One DC on an old template or none, the others fine

If every DC is fine and one user fails, check whether the account requires a smart card. SMARTCARD_REQUIRED is 0x40000 (262144) in userAccountControl, and Microsoft says "When this flag is set, it forces the user to log on by using a smart card." The bitwise matching rule OID 1.2.840.113556.1.4.803 is Microsoft's LDAP_MATCHING_RULE_BIT_AND:

# Read-only: accounts that must use a smart card (userAccountControl bit 0x40000)
Get-ADUser -LDAPFilter '(userAccountControl:1.2.840.113556.1.4.803:=262144)' |
  Select-Object -Property SamAccountName, DistinguishedName
Enter fullscreen mode Exit fullscreen mode

Step 11: 0xE, encryption types (read-only)

0xE is the least common of these in 4771 (our reading), but it gets more likely as RC4 goes away. Microsoft's RC4 page says "Microsoft plans to disable RC4 use as the default assumed supported encryption type for Active Directory domain controllers by the end of the second quarter of 2026." The same page says the 4768 and 4769 events on Windows Server 2019 and later DCs carry encryption type fields, including msDS-SupportedEncryptionTypes, Available Keys, and the client's Advertized Etypes. Read the account's attribute with Microsoft's own form:

# Read-only: Microsoft's form for reading msDS-SupportedEncryptionTypes on an account
$accountName = 'APP07'
$parameters = @{
  Filter     = "Name -eq '$($accountName)' -and (ObjectClass -eq 'Computer' -or ObjectClass -eq 'User')"
  Properties = 'msDS-SupportedEncryptionTypes'
}
Get-ADObject @parameters | Format-List -Property DistinguishedName, 'msDS-SupportedEncryptionTypes', Name, ObjectClass
Enter fullscreen mode Exit fullscreen mode
Finding What it means (Microsoft's text where quoted)
The value is 0 or not set Microsoft's table: "Not defined - defaults to RC4_HMAC_MD5"; on newer DCs that assumption is what the RC4 changes remove
Only RC4 (0x4) An account or device that can't use AES; Microsoft's page says you can use these fields "to determine if a client or target machine doesn't support AES-SHA1 or only supports RC4."
USE_DES_KEY_ONLY set in userAccountControl Microsoft: "Restrict this principal to use only Data Encryption Standard (DES) encryption types for keys." DES is long gone from current Windows defaults (our reading)
Includes AES, and 0xE persists Read the 4768 for the same request and the client's Advertized Etypes before changing anything

Microsoft's guidance on that page is to define the attribute on the account rather than let the KDC fall back to a domain default, and to read its linked hardening guidance first; that's a change, so it waits for Step 12.


Step 12: Change one link (deliberate changes)

By now you have one account, one code, and one machine or one DC. Change only the link that code points at, write down the time, and leave everything else alone:

Code and finding The change Notes
0x18, a stale credential on one machine Update the password where that machine stores it (the service, the task, the app pool, the saved credential, the phone) Finding which one is the lockout post's job; resetting the account's password again only moves the problem (our reading)
0x18, many accounts from one address Contain that machine or relay and hand it to security Don't unlock or reset accounts until the source is stopped (our reading)
0x18 for a computer account, Test-ComputerSecureChannel returns $false Test-ComputerSecureChannel -Repair on that machine; Microsoft says -Repair "removes and then rebuilds the channel established by the NetLogon service." Follow the trust relationship post for the order and the account to use
0x12, disabled or expired Re-enable or extend only if the owner confirms the account is still needed; otherwise retire what's still using it Disabled or expired on purpose means the 4771s are the cleanup list (our reading)
0x12, locked out Fix the 0x18 source first, then unlock The lockout post covers the unlock and the reset window
0x17 Set a new password, then update everything that stores it For a service account, plan the update across every server that runs it (our reading)
0x25 Fix the machine's time source; Microsoft's resync form is below Don't raise the domain's clock tolerance
0x10 Enroll the DC for a certificate from the Kerberos Authentication template, or fix its CRL or chain One DC at a time; read certutil -DCInfo Verify after each
0xE Set msDS-SupportedEncryptionTypes on the account to a value that includes AES, after reading Microsoft's linked hardening guidance Microsoft: "After finding the right combination for your environment, restart the machine and it updates its msDS-SupportedEncryptionTypes attributes in the AD database."

Microsoft's resync for a clock that won't correct itself, run against the machine behind the Client Address:

# Change: make the target re-find its time sources and resync (Microsoft's form)
w32tm /resync /computer:APP07.contoso.com /rediscover
Enter fullscreen mode Exit fullscreen mode

Microsoft: "The /rediscover option instructs the computer to check the network for new or updated time sources." If the machine's source is wrong by configuration, a resync only fixes it until the next drift; the time sync post covers setting the source (our reading).

Before you close the ticket, check that nobody took the shortcut the helpdesk asked about. Accounts with DONT_REQ_PREAUTH (0x400000, 4194304) never log 4771, and Microsoft's flag description is "This account doesn't require Kerberos pre-authentication for logging on.":

# Read-only: accounts set to not require Kerberos pre-authentication (userAccountControl bit 0x400000)
Get-ADUser -LDAPFilter '(userAccountControl:1.2.840.113556.1.4.803:=4194304)' |
  Select-Object -Property SamAccountName, DistinguishedName
Enter fullscreen mode Exit fullscreen mode

Anything on that list should have a written reason and an owner; the 4771 page is clear that you won't see pre-authentication failures for those accounts at all (our reading of what that means for monitoring).


Step 13: Prove it on every DC (read-only)

Read the same account and code on every DC from the time of the change, with the event data filtered in the query itself. Microsoft's reference for Get-WinEvent says "When Get-WinEvent can't interpret a key/value pair, it interprets the key as a case-sensitive name for the event data in the event." so TargetUserName works as a key:

# Read-only: any 4771 for the account on any DC since the change, and its successful 4768s
$changeTime = Get-Date -Date '2026-10-19 14:00'
$dcs = Get-ADDomainController -Filter * | Select-Object -ExpandProperty HostName
foreach ($dc in $dcs) {
  $fail = Get-WinEvent -ComputerName $dc -FilterHashtable @{ LogName='Security'; Id=4771; StartTime=$changeTime; TargetUserName='svc-backup' } -ErrorAction SilentlyContinue
  $ok   = Get-WinEvent -ComputerName $dc -FilterHashtable @{ LogName='Security'; Id=4768; StartTime=$changeTime; TargetUserName='svc-backup'; Status='0x0' } -ErrorAction SilentlyContinue
  [pscustomobject]@{ DC = $dc; Failures4771 = ($fail | Measure-Object).Count; Success4768 = ($ok | Measure-Object).Count }
}
Enter fullscreen mode Exit fullscreen mode

The 4768 success check uses the Status field Microsoft's 4768 sample shows as 0x0 for an issued TGT, and success auditing has to be on for it to appear (our reading of the subcategory page). Then repeat Step 4's grouping for the whole domain, so the next-busiest account and address are on the list before the next ticket.

Pass criteria (our reading): no new 4771 for that account from that Client Address on any DC for a full business day, including the times the service or task runs; 4768 successes for the account if success auditing is on; for 0x25, w32tm /stripchart from the same machine shows an offset well inside the tolerance after a restart; for 0x10, a smart card sign-in works against each DC you changed; nothing added to the no-preauthentication list; auditing still on for every DC.


Common false starts

False start Why it doesn't help (our reading unless noted)
Ticking Do not require Kerberos preauthentication to stop the alerts Microsoft's 4771 page says the event isn't generated for those accounts; the failures are hidden and the account is weaker
Turning off Kerberos Authentication Service auditing because the volume is high Microsoft recommends failure auditing on DCs because "You will also be able to detect Kerberos issues or possible attack attempts."
Treating every 4771 as a wrong password Only 0x18 is; 0x12, 0x17, 0x25, 0x10, and 0xE each point somewhere else (Step 4)
Resetting the user's password for 0x18 If the source is a device with the old password, the new one makes it fail too
Unlocking the account over and over The lock comes back until the 0x18 source is fixed; the lockout post covers it
Raising the clock tolerance for 0x25 One machine's clock is wrong; Microsoft advises keeping the tolerance at 5 minutes
Reading one DC The client may have asked another DC; read them all (Step 2)
Waiting for the certificate fields to name the smart card Microsoft: "Always empty for 4771 events."
Building an alert on Event 4772 Microsoft: "Currently this event doesn't generate."
Expecting badPwdCount to match the 4771 count The two most recent passwords don't increment it, and it isn't replicated (Step 7)
Reading the old lockout flag in userAccountControl Microsoft moved it to the computed attribute in a Windows Server 2003-based domain (Step 8)

When a change is justified

Finding Prefer Avoid
Stale credential on one machine Update it where it's stored Resetting the account's password again
Password spray from one address Contain the source, then review the accounts it hit Unlocking or resetting first
Computer account secure channel broken Test-ComputerSecureChannel -Repair on that machine Deleting and re-joining without reading the trust post
Account disabled or expired on purpose Retire what still uses it Re-enabling it to quiet the log
Password expired on a service account New password, updated on every server that runs it Setting the password to never expire to dodge the event
One machine's clock off Fix its time source, resync Raising the domain's clock tolerance
DC missing a KDC certificate Enroll from the Kerberos Authentication template Disabling smart card requirements on the accounts
Account limited to RC4 or DES Set AES-capable encryption types after reading Microsoft's guidance Re-enabling RC4 domain-wide
Alert volume too high Tune the alert to code, account, and address patterns Turning off the audit subcategory

FAQ

What does Event 4771 Kerberos pre-authentication failed mean?
The domain controller refused to issue a ticket-granting ticket. Microsoft: "This event generates every time the Key Distribution Center fails to issue a Kerberos Ticket Granting Ticket (TGT)." The Failure Code says why, and the Client Address says from where (Steps 3 and 4).

What is failure code 0x18 in Event 4771?
KDC_ERR_PREAUTH_FAILED. Microsoft's table says "The wrong password was provided." With Pre-Authentication Type 2 it's a password; one account from one address at a steady rate is usually a stale credential, many accounts from one address is a spray (Steps 5 and 7, our reading).

What do 0x12 and 0x25 mean?
0x12 is KDC_ERR_CLIENT_REVOKED; Microsoft's 4768 page gives the causes as "account disabled, expired, or locked out." 0x25 is KRB_AP_ERR_SKEW, a client clock outside the Kerberos tolerance, which Microsoft advises keeping at 5 minutes (Steps 8 and 9).

What is Pre-Authentication Type 2 versus 15?
Microsoft: type 2 "is normal for standard password authentication." and type 15 is "Used for Smart Card logon authentication." So 0x18 with type 2 is a password problem, and 0x10 with 15 or 16 is the smart card and DC certificate side (Steps 5 and 10).

What's the difference between Event 4771 and Event 4625?
4771 is written on a domain controller when the KDC refuses a TGT. 4625 is written where the sign-in was attempted; Microsoft says it "generates on the computer where logon attempt was made". Use 4771's Client Address to find the machine, then that machine's 4625 for the process and logon type (Steps 2 and 6).


Related posts

Free checklist

Disabling Kerberos pre-authentication on a service account, or turning off Kerberos auditing on every DC, before anyone read which Failure Code and Client Address the 4771s carried, is a change made everywhere at once. So is a Conditional Access policy enforced before anyone read the report-only results. The free Conditional Access pre-enforcement checklist keeps break-glass accounts, pilot groups, and report-only review on one page:

👉 https://cashflow4375.gumroad.com/l/ujkqxb?utm_source=devto&utm_medium=article&utm_campaign=aps_first_sale&utm_content=event-4771-kerberos-pre-authentication-failed

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-4771-kerberos-pre-authentication-failed


Admin Pack Studio; not affiliated with Microsoft. Steps 1-11 and 13 are read-only checks: auditpol /get, Get-ADDomainController, Get-WinEvent against each DC's Security log, the event XML through ToXml(), Group-Object, Resolve-DnsName, Test-ComputerSecureChannel without -Repair, Get-ADDomain, Get-ADUser and Search-ADAccount against the PDC emulator, Get-ADObject for encryption types, w32tm /stripchart and /query, Get-ChildItem on Cert:\LocalMachine\My, and certutil -DCInfo Verify. Updating a stored credential, repairing a secure channel, re-enabling, extending, or unlocking an account, setting a password, resyncing time, enrolling a DC certificate, and setting encryption types are deliberate changes. Change one link at a time, write down the time, prove it on every DC for a full business day, and check current Microsoft Learn for version-specific behavior.

Top comments (0)