When it is written
A domain controller writes event 40 when a sign-in with a certificate (PKINIT) reaches its Key Distribution Center (KDC) in Compatibility mode and the certificate is valid but has no strong mapping and no security identifier (SID) extension, and it was issued before the account it maps to was created. The event text opens with the same sentence as event 39 and then says that the certificate also predated the user it mapped to, so it was rejected: the KDC refuses the sign-in, and Microsoft lists the event as an Error. To the fields of event 39 it adds the time the certificate was issued and the time the account was created.
Microsoft documents the event for Compatibility mode only. In Full Enforcement a certificate without a strong mapping or the SID extension is refused whatever its date, and Microsoft says a refused sign-in shows as event 39. The September 9, 2025 update ends support for the registry value that kept a domain controller in Compatibility mode, so domain controllers with that update or a later one are not expected to write 40 any more.
The date check applies only to weak mappings: Microsoft says certificate and account times are not compared when a strong mapping exists. The event template words the first sentence with "in a secure way" where KB5014754 prints "in a strong way", and adds a line for the certificate's issuance policies that the KB does not show. Windows Server 2008 SP2 and Windows Server 2008 R2 SP1 domain controllers write the same condition as event 48.
How to turn it on
Microsoft-Windows-Kerberos-Key-Distribution-Center writes the event to the System log (Event Viewer > Windows Logs > System), which is on by default. Microsoft
The event exists on domain controllers with the May 10, 2022 or a later Windows update (KB5014754) and is written only in Compatibility mode, StrongCertificateBindingEnforcement set to 1. To read the value:
reg query "HKLM\SYSTEM\CurrentControlSet\Services\Kdc" /v StrongCertificateBindingEnforcement
With 2 (Full Enforcement) the event is not written. The February 11, 2025 update moved domain controllers without the value to Full Enforcement, and the September 9, 2025 update ends support for the value altogether.
The tolerance between the certificate's issue time and the account's creation time is CertificateBackdatingCompensation (REG_DWORD, in seconds) under the same key:
reg query "HKLM\SYSTEM\CurrentControlSet\Services\Kdc" /v CertificateBackdatingCompensation
Microsoft's registry table gives 10 minutes as the default when it is absent and 50 years (0x5E0C89C0) as the maximum. It works only in Compatibility mode, has no effect when StrongCertificateBindingEnforcement is 2 and does not affect strong mappings. A certificate older than its account but within the tolerance signs in with a warning, for which Microsoft does not give an event ID.
Fields
In Event Viewer order. The field names are those of the event XML, from the event template of Windows Server 2025 (build 26100.32230, January 13, 2026): the provider belongs to a server role, so the template comes from the provider manifests that the EVTX-ETW-Resources project exported from that release.
| Field | What it holds | Since |
|---|---|---|
UserAccountName | Account the certificate was mapped to (User), by its principal name in Microsoft's placeholder. Computer accounts end with $. | v0 |
Certificate SubjectSubject | Subject name of the certificate (Certificate Subject), written in forward order (a mapping in altSecurityIdentities needs it reversed). | v0 |
Certificate IssuerIssuer | Name of the CA that issued the certificate (Certificate Issuer). | v0 |
Certificate Serial NumberSerialNumber | Serial number of the certificate (Certificate Serial Number), which identifies it on the issuing CA. | v0 |
Certificate ThumbprintThumbprint | Thumbprint of the certificate (Certificate Thumbprint). | v0 |
Certificate Issuance PoliciesIssuancePolicies | Issuance policies of the certificate (Certificate Issuance Policies): the policy object identifiers a CA puts in a certificate to say how far its identity can be trusted. The template has this line, KB5014754's event text does not, and Microsoft does not document its format; the sample leaves it empty. | v0 |
Certificate Issuance TimeIssuanceTime | When the certificate was issued (Certificate Issuance Time). Microsoft's placeholder calls it the certificate's FILETIME; the template stores it as text and Microsoft does not show how it is written. The sample shows the FILETIME as a decimal number, an assumption. | v0 |
Account Creation TimeAccountCreationTime | When the account object was created in Active Directory (Account Creation Time), a FILETIME in Microsoft's placeholder, written as text like IssuanceTime. Later than the issuance time by more than the tolerance in this event. | v0 |
Binary dataBinary | Binary data the KDC attaches to the event. Microsoft does not document what it holds for event 40; rules do not need it. | v0 |
Values to know
Account Creation Time AccountCreationTime
| Value | Meaning | Signal |
|---|---|---|
Later than IssuanceTime by more than the tolerance | The certificate is older than the accountWhy the KDC refused the sign-in. A certificate issued for a name before the current account held it was issued to something else; find on the issuing CA who requested it and from which template. | Attack signal |
Later by less than CertificateBackdatingCompensation | Within the toleranceNot written as 40 when the value is configured: Microsoft says the sign-in is allowed with a warning. | Noise |
User AccountName
| Value | Meaning | Signal |
|---|---|---|
Ends with $ | A computer accountReissue the computer's certificate, or map it strongly to the current account. | Worth knowing |
Any other account | A user accountAn account created after the certificate, for example one deleted and created again under the same name. Reissue the certificate or add a strong explicit mapping. | Worth knowing |
Volume and noise
Rare. The event needs a certificate that names an account created after the certificate was issued, with nothing but a weak mapping tying the two, and a domain controller still in Compatibility mode. Microsoft's troubleshooting steps treat it as a certificate to replace or to map strongly to the account.
A certificate only slightly older than its account can fall within a tolerance, CertificateBackdatingCompensation. Microsoft says a configured value lets such a certificate sign in with a warning instead of this error. The article is not consistent about the case without the value: its registry section gives a default of 10 minutes (matching AD CS), while its description of Compatibility mode says the sign-in fails when the value is not present.
Keeping it manageable
- Match the provider as well as the event ID: IDs in the System log repeat across providers. The template writes the provider
Microsoft-Windows-Kerberos-Key-Distribution-Centerwith the event source nameKDC; KB5014754 gives the source asKdcsvc. The rules accept both names. - Investigate every event rather than filtering: each one is a refused sign-in with a certificate older than its account, and the volume is low.
- Do not raise
CertificateBackdatingCompensationto make the events stop. Microsoft calls the value a temporary workaround that disables a security check; reissue the certificate or add a strong explicit mapping instead. - Once every domain controller has the September 9, 2025 or a later update, expect refusals of this kind as event 39; keep both IDs in collection and in the rule.
Sample event
Version 0, with made-up values.
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-Kerberos-Key-Distribution-Center" Guid="{3FD9DA1A-5A54-46C5-9A26-9BD7C0685056}" EventSourceName="KDC" />
<EventID Qualifiers="32768">40</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2026-11-18T09:30:12.4567890Z" />
<EventRecordID>1048576</EventRecordID>
<Correlation />
<Execution ProcessID="712" ThreadID="2408" />
<Channel>System</Channel>
<Computer>DC01.corp.example.com</Computer>
<Security />
</System>
<EventData>
<Data Name="AccountName">bob</Data>
<Data Name="Subject">CN=bob, OU=Staff, DC=corp, DC=example, DC=com</Data>
<Data Name="Issuer">CN=CORP-CA01, DC=corp, DC=example, DC=com</Data>
<Data Name="SerialNumber">2a00000017c4e8b2a59d3f61000000000017</Data>
<Data Name="Thumbprint">8b1e4f6a2c9d7e3051a4b8c2f6d0e9a7b3c5d1f4</Data>
<Data Name="IssuancePolicies"></Data>
<Data Name="IssuanceTime">133540173270000000</Data>
<Data Name="AccountCreationTime">133940377310000000</Data>
</EventData>
</Event>Attacks this event reveals
Detection rules that read this event:
Frequently asked questions
Why does event 40 say the certificate predated the user?
The domain controller compares the time the certificate was issued with the time the account it maps to was created. When the certificate is older, has only a weak mapping and no SID extension, and the gap is outside the backdating tolerance (CertificateBackdatingCompensation), the KDC in Compatibility mode refuses the sign-in and writes event 40.
Is event 40 still written on current domain controllers?
Microsoft documents it only for Compatibility mode. The February 11, 2025 update moved domain controllers to Full Enforcement unless StrongCertificateBindingEnforcement was set to 1, and the September 9, 2025 update ends support for that value. Under enforcement such a certificate is refused for lacking a strong mapping, which Microsoft reports as event 39.
What does CertificateBackdatingCompensation change?
It sets, in seconds, how much older than the account a weakly mapped certificate may be before the KDC refuses it. It works only in Compatibility mode and does not affect strong mappings. Microsoft calls it a temporary workaround that disables a security check, so a raised value deserves a question.
References
- KB5014754: Certificate-based authentication changes on Windows domain controllers (Microsoft)
- 4720(S): A user account was created (Microsoft)
- ICertificatePolicy interface, issuance policies (Microsoft)
- Event ID 7 is intermittently logged on a Windows Server 2025-based domain controller (Microsoft sample of a KDC event in the System log)