1. Resources
  2. Detection sources
  3. Event ID 4881

Event ID 4881: Certificate Services stopped

Written by an AD CS certification authority when Certificate Services stops, with hashes of the CA database, certificate and public key. Many CA settings changed in the registry, the audit filter among them, apply only after such a restart.

Log source
Windows Security log
Detection value
Context
Volume
Low (estimate)
Last updated
Audit subcategory
Audit Certification Services (Object Access, Success and Failure)
Logged on
Certification authority servers only
Event versions
0
Detects
Not read by our detection rules yet

When it is written

A certification authority (CA) running Active Directory Certificate Services writes 4881 to its own Security log when Certificate Services stops, and 4880 (Certificate Services started) when it starts again. Microsoft documents that with the "Start and stop Active Directory Certificate Services" audit category the CA takes a cryptographic hash of its database at each start and stop; the event also carries a hash of the CA certificate, a hash of the CA public key and a private key usage count. It names no account. A stop asked for with the CA's shutdown command is preceded by 4875 (Certificate Services received a request to shut down).

The stop matters for what comes after it: Microsoft's procedures for the CA's registry settings, such as the audit filter (AuditFilter), the policy module flags (EditFlags) and the interface flags (InterfaceFlags), restart Certificate Services to apply them. The event needs the Audit Certification Services subcategory on the CA server and the "Start and stop Active Directory Certificate Services" category in the CA's own audit filter.

How to turn it on

Advanced audit policy subcategory Audit Certification Services, Success and Failure. Set it in a Group Policy object linked to the computers that write the event:

Computer Configuration > Policies > Windows Settings > Security Settings > Advanced Audit Policy Configuration > Audit Policies > Object Access > Audit Certification Services
Microsoft's recommendation per computer role
ComputerAuditNote
Domain controllersSuccess if needed and Failure if neededMicrosoft marks every column "IF" (the same in its general and stronger baselines). Enable the subcategory when the server has the Active Directory Certificate Services role installed and you need to monitor AD CS events.
Member serversSuccess if needed and Failure if neededMicrosoft marks every column "IF" (the same in its general and stronger baselines). Enable the subcategory when the server has the Active Directory Certificate Services role installed and you need to monitor AD CS events.
WorkstationsNot loggedMicrosoft says the AD CS role cannot be installed on a client operating system.
Check the current setting
auditpol /get /subcategory:"Certification Services"
Based on vendor documentation.
Turn it on (local policy; a domain GPO overrides it)
auditpol /set /subcategory:"Certification Services" /success:enable /failure:enable
Based on vendor documentation.
The same on a Windows in another display language
auditpol /get /subcategory:"{0CCE9221-69AE-11D9-BED3-505054503030}"
Based on vendor documentation.

Run the commands in an elevated prompt on a computer that writes the event. Subcategory settings take effect only when the security option Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings is enabled (the default), and a Group Policy object that sets advanced audit policy replaces local changes at its next refresh. Microsoft's advanced audit policy reference

Two settings must both be on, on every CA server:

  1. The Audit Certification Services subcategory, Success and Failure (Microsoft's PKI monitoring guide asks for both).
  2. The Start and stop Active Directory Certificate Services category in the CA's own audit filter: the Auditing tab of the CA's properties in the Certification Authority console, or bit value 1 of the CA's AuditFilter registry value (all seven categories together are 127). Microsoft's procedure restarts Certificate Services after the filter is changed. To read the current value on the CA: certutil -getreg CA\AuditFilter.

Microsoft cautions that this category hashes the CA database at every start and stop, which can delay a restart on a CA with a large database. Test the effect on a non-production CA first.

Fields

In Event Viewer order. The field names are those of the event XML, from the event template that ships with Windows.

FieldWhat it holdsSince
Certificate Database HashCertificateDatabaseHashCertificate Services stopped.Hash of the CA database when the service stopped (shown as Certificate Database Hash). Microsoft documents that the CA hashes its database at start and stop when the start and stop category is audited, but not the algorithm or the format.v0
Private Key Usage CountPrivateKeyUsageCountCertificate Services stopped.A count of uses of the CA private key, as its name says (shown as Private Key Usage Count). Microsoft does not document what the count covers or when it resets, so read it from your own CA's events before you rely on it.v0
CA Certificate HashCACertificateHashCertificate Services stopped.Hash of the CA's certificate (shown as CA Certificate Hash). Microsoft does not document the algorithm; the CA's own list of certificate thumbprints is the CaCertHash registry entry.v0
CA Public Key HashCAPublicKeyHashCertificate Services stopped.Hash of the CA's public key (shown as CA Public Key Hash). Microsoft does not document the algorithm or format.v0

Values to know

CA Certificate Hash CACertificateHash

ValueMeaningSignal
The same value as at earlier stopsThe CA runs with the certificate it hadExpected
A new value after a planned CA certificate renewalThe CA now signs with its renewed certificateExpected
A new value with no renewal on recordThe CA certificate changed outside a planned renewalThe CA keeps the thumbprints of all its certificates in the CaCertHash registry entry. Check the new certificate against it and against your change record.Worth knowing

CA Public Key Hash CAPublicKeyHash

ValueMeaningSignal
The same value as at earlier stopsThe CA still uses the same key pairExpected
A new valueThe CA now uses a new key pair, which only a renewal with a new key should bringWorth knowing

Volume and noise

Very low. The service stops for configuration changes, updates, server restarts and maintenance. Microsoft lists abnormal startup or shutdown events among the activity to monitor on a CA, and rates this event low. Microsoft also warns that on a CA with a large database the hash makes start and stop slow, and the CA's RPC interface is unavailable while it is computed.

Keeping it manageable

  • Keep every event: there are few, and each restart is a moment when a registry change to the CA takes effect.
  • Match each stop with the next start (4880) and with a change record or maintenance window. For a restart outside them, look for registry changes on the CA's configuration key just before it (4657, with registry auditing) and for changes made through the console (4885, 4891).
  • Keep CACertificateHash and CAPublicKeyHash from each stop: they should change only when the CA certificate is renewed (the public key only when the renewal also makes a new key).
  • If start and stop take too long on a large CA, Microsoft's guidance is to review the effect on a non-production CA and choose the audit categories of your approved baseline.

Sample event

Version 0, with made-up values.

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-a5ba-3e3b0328c30d}" />
    <EventID>4881</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2026-11-18T09:30:12.4567890Z" />
    <EventRecordID>1048576</EventRecordID>
    <Correlation />
    <Execution ProcessID="712" ThreadID="2408" />
    <Channel>Security</Channel>
    <Computer>CA01.corp.example.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="CertificateDatabaseHash">3c9a51e07f24b86d1e0a5f93c2d84b7160e9a3f2</Data>
    <Data Name="PrivateKeyUsageCount">18342</Data>
    <Data Name="CACertificateHash">8e4f0d27a91c35b6e2f7c0d48a1b9e53f6c2d071</Data>
    <Data Name="CAPublicKeyHash">b1d7e0c46a2f9853e1c07b4d92a6f3e5108c7d4a</Data>
  </EventData>
</Event>

Attacks this event reveals

No detection rule or detection logic in our library reads this event yet. It is documented here because it sits next to the events they read: it explains them, follows from them or is the trace a defender looks for around them (see Related events).

Frequently asked questions

Who stopped Certificate Services?

The event names no account. A stop asked for with the CA's shutdown command writes 4875 first. Otherwise look at who was signed in to the CA server at that time (4624) and at the change record.

Why does a CA restart matter for security monitoring?

Microsoft's procedures apply changes to the CA's registry settings, such as the audit filter and the policy module flags, by restarting Certificate Services. A restart outside maintenance is the moment to compare the CA's configuration with your baseline, and registry auditing of the CA's configuration key (event 4657) shows what changed before it.

Why does Certificate Services take so long to stop or start?

With the start and stop audit category on, the CA hashes its database at each start and stop. Microsoft warns that on a large database this can make start and stop very long, and that the CA's RPC interface is unavailable meanwhile.

References