ANAVEM
Languagefr
Windows security monitoring dashboard displaying certificate services events and PKI security logs
Event ID 4886InformationMicrosoft-Windows-Security-AuditingWindows

Windows Event ID 4886 – Microsoft-Windows-Security-Auditing: Certificate Services Template Security Descriptor Modified

Event ID 4886 fires when security permissions on a Certificate Authority template are modified. Critical for PKI security monitoring and compliance auditing in Active Directory environments.

Emanuel DE ALMEIDAEmanuel DE ALMEIDA
18 March 202612 min read 0
Event ID 4886Microsoft-Windows-Security-Auditing 5 methods 12 min
Event Reference

What This Event Means

Event ID 4886 represents a security audit event generated by the Microsoft-Windows-Security-Auditing provider when Certificate Authority template security descriptors undergo modification. This event occurs within Active Directory Certificate Services environments and provides detailed logging of permission changes that affect certificate template access controls.

The event captures comprehensive details about the security modification, including the template name, the user account making the change, the specific permissions altered, and the security identifier (SID) of both the modifier and the template object. Windows generates this event on Certificate Authority servers and domain controllers that host the Certificate Services configuration partition.

From a security perspective, this event is crucial for detecting unauthorized changes to certificate template permissions that could compromise PKI infrastructure. Attackers often target certificate templates to gain unauthorized certificate issuance capabilities, which can lead to authentication bypass, code signing abuse, or encrypted communication interception. The event provides forensic evidence of when template permissions changed and who initiated the modification.

In enterprise environments running Windows Server 2025 and earlier versions, this event integrates with Security Information and Event Management (SIEM) systems for automated threat detection and compliance reporting. The event structure includes standardized fields that facilitate automated parsing and correlation with other security events across the PKI infrastructure.

Applies to

Windows Server 2019Windows Server 2022Windows Server 2025
Analysis

Possible Causes

  • Administrator modifying certificate template enrollment permissions through Certificate Templates MMC
  • PowerShell scripts using PKI cmdlets to alter template security settings
  • Group Policy changes affecting certificate template access controls
  • Direct LDAP modifications to template objects in Active Directory
  • Certificate Authority management tools updating template permissions
  • Automated PKI management solutions changing template security descriptors
  • Security group membership changes affecting template access inheritance
  • Template duplication or import operations that modify default permissions
Resolution Methods

Troubleshooting Steps

01

Review Event Details in Event Viewer

Start by examining the complete event details to understand what template permissions changed and who initiated the modification.

  1. Open Event Viewer on your Certificate Authority server or domain controller
  2. Navigate to Windows LogsSecurity
  3. Filter for Event ID 4886 using the filter option
  4. Double-click the event to view detailed information including:
    • Subject account that made the change
    • Template name and distinguished name
    • Old and new security descriptor values
    • Process information and logon session details
  5. Document the template name, user account, and timestamp for further investigation
  6. Check if the change aligns with authorized PKI maintenance activities

Review the Old Security Descriptor and New Security Descriptor fields to identify exactly which permissions changed. Compare these values to determine if enrollment rights, read permissions, or administrative access was modified.

02

Query Events with PowerShell for Pattern Analysis

Use PowerShell to analyze multiple Event ID 4886 occurrences and identify patterns or suspicious activity across your PKI infrastructure.

  1. Run this PowerShell command to retrieve recent template security modifications:
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4886} -MaxEvents 50 | Select-Object TimeCreated, @{Name='User';Expression={$_.Properties[1].Value}}, @{Name='Template';Expression={$_.Properties[4].Value}}, @{Name='ProcessName';Expression={$_.Properties[9].Value}} | Format-Table -AutoSize
  1. For detailed analysis of specific template changes, use:
$Events = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4886} -MaxEvents 100
foreach ($Event in $Events) {
    $XML = [xml]$Event.ToXml()
    $Properties = $XML.Event.EventData.Data
    Write-Host "Time: $($Event.TimeCreated)"
    Write-Host "User: $($Properties[1].'#text')"
    Write-Host "Template: $($Properties[4].'#text')"
    Write-Host "Process: $($Properties[9].'#text')"
    Write-Host "---"
}
  1. Export results to CSV for further analysis:
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4886} | Select-Object TimeCreated, Id, LevelDisplayName, @{Name='Message';Expression={$_.Message}} | Export-Csv -Path "C:\Temp\Event4886_Analysis.csv" -NoTypeInformation

Analyze the output for unusual patterns such as multiple template modifications by the same user, changes during off-hours, or modifications to high-privilege templates.

03

Verify Certificate Template Current Permissions

Validate the current state of certificate template permissions to ensure they align with security policies and identify any unauthorized changes.

  1. Open the Certificate Templates MMC snap-in on your Certificate Authority server
  2. Navigate to StartRun → type certtmpl.msc
  3. Locate the template mentioned in the Event ID 4886 log entry
  4. Right-click the template and select Properties
  5. Click the Security tab to review current permissions
  6. Document the current security settings and compare with your organization's PKI security baseline
  7. Use PowerShell to enumerate template permissions programmatically:
Import-Module ActiveDirectory
$TemplateName = "WebServer" # Replace with your template name
$TemplateDN = "CN=$TemplateName,CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration," + (Get-ADDomain).DistinguishedName
$Template = Get-ADObject -Identity $TemplateDN -Properties nTSecurityDescriptor
$SD = $Template.nTSecurityDescriptor
$SD.Access | Select-Object IdentityReference, AccessControlType, ActiveDirectoryRights | Format-Table -AutoSize
  1. Check for unexpected permissions such as:
    • Domain Users with Enroll rights
    • Unauthorized security groups with Full Control
    • Service accounts with excessive permissions
  2. Remediate any unauthorized permissions immediately
Warning: Modifying certificate template permissions can impact certificate enrollment across your domain. Test changes in a lab environment first.
04

Correlate with Active Directory Changes and User Activity

Cross-reference Event ID 4886 with related Active Directory events to build a complete picture of the security modification and identify potential security incidents.

  1. Query for related security events around the same timeframe:
$StartTime = (Get-Date).AddHours(-2)
$EndTime = Get-Date
$RelatedEvents = Get-WinEvent -FilterHashtable @{
    LogName='Security'
    Id=4624,4625,4648,4768,4769,4886
    StartTime=$StartTime
    EndTime=$EndTime
} | Sort-Object TimeCreated
  1. Check for suspicious logon events (4624) or authentication failures (4625) from the same user account
  2. Look for Kerberos ticket events (4768, 4769) that might indicate lateral movement
  3. Review Directory Service Access events (5136, 5137, 5139) for related AD modifications:
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=5136,5137,5139} -MaxEvents 100 | Where-Object {$_.Message -like "*Certificate*" -or $_.Message -like "*Template*"} | Select-Object TimeCreated, Id, Message
  1. Examine the user account that made the template modification:
    • Verify the account is authorized for PKI administration
    • Check recent password changes or account modifications
    • Review group membership and privilege assignments
  2. Use this PowerShell script to analyze user activity patterns:
$UserAccount = "DOMAIN\username" # Replace with actual account from event
$UserEvents = Get-WinEvent -FilterHashtable @{
    LogName='Security'
    StartTime=(Get-Date).AddDays(-7)
} | Where-Object {$_.Message -like "*$UserAccount*"}
$UserEvents | Group-Object Id | Select-Object Name, Count | Sort-Object Count -Descending
  1. Document findings and escalate if unauthorized activity is detected
05

Implement Advanced Monitoring and Alerting

Establish proactive monitoring for Event ID 4886 to detect future unauthorized certificate template modifications in real-time.

  1. Create a custom Windows Event Forwarding (WEF) subscription to centralize Event ID 4886 collection:
<Subscription xmlns="http://schemas.microsoft.com/2006/03/windows/events/subscription">
    <SubscriptionId>PKI-Template-Security-Changes</SubscriptionId>
    <SubscriptionType>SourceInitiated</SubscriptionType>
    <Description>Certificate Template Security Modifications</Description>
    <Enabled>true</Enabled>
    <Uri>http://schemas.microsoft.com/wbem/wsman/1/windows/EventLog</Uri>
    <ConfigurationMode>Custom</ConfigurationMode>
    <Query>
        <![CDATA[
        <QueryList>
            <Query Id="0">
                <Select Path="Security">*[System[EventID=4886]]</Select>
            </Query>
        </QueryList>
        ]]>
    </Query>
</Subscription>
  1. Set up a PowerShell scheduled task for automated alerting:
$Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-File C:\Scripts\Monitor-Event4886.ps1"
$Trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 15) -RepetitionDuration (New-TimeSpan -Days 365)
$Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable
Register-ScheduledTask -TaskName "PKI-Template-Monitor" -Action $Action -Trigger $Trigger -Settings $Settings -User "SYSTEM"
  1. Create the monitoring script C:\Scripts\Monitor-Event4886.ps1:
# Monitor-Event4886.ps1
$LastCheck = (Get-Date).AddMinutes(-15)
$NewEvents = Get-WinEvent -FilterHashtable @{
    LogName='Security'
    Id=4886
    StartTime=$LastCheck
} -ErrorAction SilentlyContinue

if ($NewEvents) {
    foreach ($Event in $NewEvents) {
        $XML = [xml]$Event.ToXml()
        $User = $XML.Event.EventData.Data[1].'#text'
        $Template = $XML.Event.EventData.Data[4].'#text'
        
        # Send alert email or SIEM notification
        $Subject = "ALERT: Certificate Template Security Modified"
        $Body = "Template: $Template`nUser: $User`nTime: $($Event.TimeCreated)"
        # Add your notification logic here
    }
}
  1. Configure Windows Event Log size and retention for the Security log:
wevtutil sl Security /ms:1073741824  # Set to 1GB
wevtutil sl Security /rt:false       # Disable log overwrite
  1. Implement baseline monitoring by documenting authorized template modifications and creating exception lists for legitimate administrative accounts
Pro tip: Integrate Event ID 4886 monitoring with your SIEM solution using Windows Event Forwarding or log shipping agents for enterprise-scale PKI security monitoring.

Overview

Event ID 4886 generates when an administrator or authorized user modifies the security descriptor (permissions) on a Certificate Authority template in Active Directory Certificate Services (AD CS). This event fires specifically when template permissions change, including modifications to enrollment rights, read permissions, or administrative access controls.

The event captures critical PKI security changes that could impact certificate issuance policies across your domain. Windows logs this event to the Security log on domain controllers and Certificate Authority servers when template security settings are altered through the Certificate Templates MMC snap-in, PowerShell commands, or direct LDAP modifications.

This audit event is essential for maintaining PKI security posture and meeting compliance requirements. Organizations running AD CS environments should monitor this event closely, as unauthorized template permission changes can lead to certificate abuse, privilege escalation, or unauthorized certificate enrollment that bypasses intended security controls.

Frequently Asked Questions

What does Event ID 4886 indicate about my PKI security?+
Event ID 4886 indicates that someone modified the security permissions on a Certificate Authority template in your Active Directory Certificate Services environment. This event is critical for PKI security because template permissions control who can enroll for certificates, read template properties, or modify template settings. Unauthorized changes to template permissions can lead to certificate abuse, privilege escalation, or unauthorized certificate issuance that bypasses your intended security controls. You should investigate each occurrence to ensure the changes were authorized and align with your PKI security policies.
How can I determine what specific permissions changed in Event ID 4886?+
Event ID 4886 includes 'Old Security Descriptor' and 'New Security Descriptor' fields that contain the before and after permission states in Security Descriptor Definition Language (SDDL) format. To interpret these values, you can use PowerShell to convert SDDL to readable format: `ConvertFrom-SddlString -Sddl 'SDDL_STRING'`. Compare the old and new descriptors to identify which users or groups gained or lost specific permissions like Enroll, Full Control, or Read. The event also shows the subject account that made the change and the process used to modify the permissions.
Should I be concerned if Event ID 4886 appears frequently in my environment?+
Frequent Event ID 4886 occurrences warrant investigation, especially if they're unexpected or involve unauthorized users. Legitimate scenarios include planned PKI maintenance, template updates during certificate lifecycle management, or automated PKI management tools making scheduled changes. However, frequent modifications could indicate: unauthorized access to PKI infrastructure, malicious actors attempting to abuse certificate templates, misconfigured automation tools, or inadequate change control processes. Establish a baseline of normal template modification patterns and investigate deviations. Implement proper change management for PKI modifications and monitor for changes during off-hours or by unauthorized accounts.
Can Event ID 4886 help detect certificate-based attacks?+
Yes, Event ID 4886 is valuable for detecting certificate-based attacks, particularly those involving template abuse. Attackers often modify certificate template permissions to gain unauthorized certificate enrollment capabilities for privilege escalation, authentication bypass, or persistent access. The event helps detect: unauthorized users gaining enrollment rights on high-privilege templates, modifications to template permissions that bypass intended security controls, changes to template settings that enable certificate abuse scenarios, and suspicious timing of template modifications that correlate with other attack indicators. Correlate Event ID 4886 with authentication events, certificate enrollment events (Event ID 4887), and other PKI-related security events for comprehensive attack detection.
What's the difference between Event ID 4886 and other certificate-related security events?+
Event ID 4886 specifically tracks certificate template security descriptor modifications, while other certificate events cover different PKI activities. Event ID 4887 logs certificate enrollment requests, Event ID 4888 tracks certificate template modifications (non-security changes), and Event ID 4889 logs certificate revocations. Event ID 4886 focuses solely on permission changes that affect who can access, enroll, or manage certificate templates. This makes it particularly important for security monitoring because template permissions are fundamental to PKI security. While other events track certificate usage and lifecycle, Event ID 4886 tracks the security controls that govern certificate template access, making it essential for detecting privilege escalation attempts and unauthorized PKI modifications.
Documentation

References (2)

Emanuel DE ALMEIDA
Written by

Emanuel DE ALMEIDA

Senior IT Journalist & Cloud Architect

Microsoft MCSA-certified Cloud Architect | Fortinet-focused. I modernize cloud, hybrid & on-prem infrastructure for reliability, security, performance and cost control - sharing field-tested ops & troubleshooting.

Discussion

Share your thoughts and insights

You must be logged in to comment.

Loading comments...