ANAVEM
Languagefr
Windows Event Viewer displaying Security log entries with Event ID 4906 on a professional monitoring dashboard
Event ID 4906InformationMicrosoft-Windows-Security-AuditingWindows

Windows Event ID 4906 – Microsoft-Windows-Security-Auditing: An attempt was made to register a security event source

Event ID 4906 fires when an application or service attempts to register itself as a security event source in the Windows Event Log system, typically during software installation or service startup.

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

What This Event Means

Event ID 4906 is generated by the Windows Security Auditing subsystem whenever a process attempts to register a new security event source. This registration is a prerequisite for any application or service that wants to write events to the Security log or establish itself as a recognized event source in the Windows Event Log architecture.

The registration process involves creating registry entries under HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Security and potentially other Event Log categories. Windows validates the requesting process's permissions and security context before allowing the registration to proceed. The event captures both successful and failed registration attempts, providing administrators with complete visibility into event source management activities.

This event is particularly relevant in enterprise environments where security monitoring tools, antivirus software, and custom applications frequently register event sources. The information logged includes the process ID, executable path, user context, and the specific event source name being registered. Modern security frameworks in Windows Server 2025 and Windows 11 24H2 have enhanced this logging to include additional context about the registration request's origin and purpose.

Applies to

Windows 10Windows 11Windows Server 2019/2022/2025
Analysis

Possible Causes

  • Software installation processes registering new event sources during setup
  • Windows services initializing their event logging capabilities at startup
  • Security monitoring tools establishing their logging infrastructure
  • Antivirus or endpoint protection software registering event sources
  • Custom applications implementing Windows Event Log integration
  • System components registering additional event sources after updates
  • Third-party management tools establishing audit logging capabilities
  • PowerShell scripts or administrative tools creating new event sources programmatically
Resolution Methods

Troubleshooting Steps

01

Review Event Details in Event Viewer

Start by examining the specific details of the Event ID 4906 occurrence to understand what triggered the registration attempt.

  1. Open Event Viewer by pressing Win + R, typing eventvwr.msc, and pressing Enter
  2. Navigate to Windows LogsSecurity
  3. Filter for Event ID 4906 by right-clicking the Security log and selecting Filter Current Log
  4. Enter 4906 in the Event IDs field and click OK
  5. Double-click on a recent Event ID 4906 entry to view detailed information
  6. Review the following key fields in the event details:
    • Process Name: The executable that initiated the registration
    • Process ID: The PID of the requesting process
    • Account Name: The user context under which the registration occurred
    • Source Name: The event source name being registered
  7. Cross-reference the process name with known applications to verify legitimacy
Pro tip: Use the Details tab in Event Viewer to copy specific field values for further investigation or documentation purposes.
02

Query Events with PowerShell

Use PowerShell to programmatically analyze Event ID 4906 occurrences and extract detailed information for investigation.

  1. Open PowerShell as Administrator
  2. Query recent Event ID 4906 entries:
    Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4906} -MaxEvents 20 | Format-Table TimeCreated, Id, LevelDisplayName, Message -Wrap
  3. Extract detailed event properties for analysis:
    $events = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4906} -MaxEvents 10
    foreach ($event in $events) {
        $eventXML = [xml]$event.ToXml()
        $processName = $eventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'ProcessName'} | Select-Object -ExpandProperty '#text'
        $sourceName = $eventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'SourceName'} | Select-Object -ExpandProperty '#text'
        Write-Host "Time: $($event.TimeCreated) | Process: $processName | Source: $sourceName"
    }
  4. Filter events by specific time range if investigating a particular incident:
    $startTime = (Get-Date).AddHours(-24)
    $endTime = Get-Date
    Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4906; StartTime=$startTime; EndTime=$endTime}
  5. Export results for further analysis:
    Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4906} -MaxEvents 50 | Export-Csv -Path "C:\Temp\Event4906_Analysis.csv" -NoTypeInformation
03

Investigate Registry Event Source Entries

Examine the Windows Registry to verify the event source registrations and identify any suspicious or unauthorized entries.

  1. Open Registry Editor by pressing Win + R, typing regedit, and pressing Enter
  2. Navigate to the main Event Log registry location:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog
  3. Examine the Security subkey to see registered security event sources:
    HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Security
  4. Look for recently created or suspicious event source entries by checking:
    • Subkey names that don't match known applications
    • Event sources with unusual or generic names
    • Recently modified timestamps on registry keys
  5. For each suspicious event source, examine the following registry values:
    • EventMessageFile: Points to the DLL containing event messages
    • TypesSupported: Defines what event types the source can generate
    • CategoryMessageFile: Specifies category message resources
  6. Cross-reference the EventMessageFile path with the process that triggered Event ID 4906
  7. Use PowerShell to query registry information programmatically:
    Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Security" | ForEach-Object {
        $sourceName = $_.PSChildName
        $messageFile = Get-ItemProperty -Path $_.PSPath -Name "EventMessageFile" -ErrorAction SilentlyContinue
        if ($messageFile) {
            Write-Host "Source: $sourceName | Message File: $($messageFile.EventMessageFile)"
        }
    }
Warning: Do not modify or delete registry entries unless you are certain they are malicious. Removing legitimate event sources can break application logging functionality.
04

Correlate with Process and File Activity

Investigate the processes and files associated with Event ID 4906 to determine if the registration attempts are legitimate or potentially malicious.

  1. Use Process Monitor (ProcMon) to monitor real-time registry and file activity during event source registrations
  2. Download ProcMon from Microsoft Sysinternals if not already available
  3. Configure ProcMon filters to focus on Event Log-related activity:
    • Set Process and Thread Activity filter to include registry operations
    • Add a Path filter containing "EventLog" to capture relevant registry access
    • Include file system activity for executables mentioned in Event ID 4906
  4. Analyze the executable files that triggered the event source registration:
    # Get file information for processes that registered event sources
    $events = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4906} -MaxEvents 10
    foreach ($event in $events) {
        $eventXML = [xml]$event.ToXml()
        $processPath = $eventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'ProcessName'} | Select-Object -ExpandProperty '#text'
        if (Test-Path $processPath) {
            $fileInfo = Get-ItemProperty -Path $processPath
            $signature = Get-AuthenticodeSignature -FilePath $processPath
            Write-Host "File: $processPath"
            Write-Host "Version: $($fileInfo.VersionInfo.FileVersion)"
            Write-Host "Signature: $($signature.Status)"
            Write-Host "Signer: $($signature.SignerCertificate.Subject)"
            Write-Host "---"
        }
    }
  5. Check Windows Defender or other security software logs for any detections related to the processes
  6. Verify digital signatures and certificate validity for suspicious executables
  7. Use Autoruns from Sysinternals to identify if any suspicious event sources are configured for automatic startup
05

Implement Advanced Monitoring and Alerting

Set up comprehensive monitoring for Event ID 4906 to detect unauthorized event source registrations and establish baseline behavior patterns.

  1. Create a custom Windows Event Forwarding (WEF) subscription to centralize Event ID 4906 monitoring across multiple systems
  2. Configure a scheduled task to run PowerShell monitoring scripts:
    # Create monitoring script: Monitor-EventSource4906.ps1
    $lastRun = Get-Date (Get-Content "C:\Scripts\LastRun.txt" -ErrorAction SilentlyContinue)
    if (-not $lastRun) { $lastRun = (Get-Date).AddHours(-1) }
    
    $newEvents = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4906; StartTime=$lastRun}
    
    foreach ($event in $newEvents) {
        $eventXML = [xml]$event.ToXml()
        $processName = $eventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'ProcessName'} | Select-Object -ExpandProperty '#text'
        $sourceName = $eventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'SourceName'} | Select-Object -ExpandProperty '#text'
        
        # Define whitelist of known good processes
        $knownProcesses = @('setup.exe', 'msiexec.exe', 'services.exe', 'svchost.exe')
        
        if ($processName -notin $knownProcesses) {
            # Send alert for unknown process registering event source
            Write-EventLog -LogName Application -Source "EventSourceMonitor" -EventId 1001 -EntryType Warning -Message "Unknown process $processName registered event source $sourceName"
        }
    }
    
    Get-Date | Out-File "C:\Scripts\LastRun.txt"
  3. Set up Windows Task Scheduler to run the monitoring script every 15 minutes
  4. Configure SIEM integration to collect and analyze Event ID 4906 patterns
  5. Create baseline documentation of legitimate event sources in your environment
  6. Implement Group Policy settings to restrict event source registration permissions where appropriate:
    • Navigate to Computer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesUser Rights Assignment
    • Review and configure Generate security audits policy
  7. Use Windows Performance Toolkit (WPT) for advanced event correlation and analysis in complex environments
Pro tip: Maintain a whitelist of approved event sources and their associated processes to reduce false positives in your monitoring system.

Overview

Event ID 4906 appears in the Security log when an application, service, or system component attempts to register itself as a security event source. This registration process allows the component to write security-related events to the Windows Event Log. The event fires during software installations, service startups, or when applications initialize their logging capabilities.

This event is part of Windows' comprehensive security auditing framework and helps administrators track which components are registering to write security events. While typically benign, monitoring these registrations can help identify unauthorized software attempting to establish logging capabilities or detect potential security tool installations.

The event contains details about the process making the registration request, the target event source name, and the security context under which the registration occurs. Understanding this event helps maintain visibility into your system's logging infrastructure and can assist in troubleshooting applications that fail to properly initialize their event logging capabilities.

Frequently Asked Questions

What does Event ID 4906 mean and why does it appear in my Security log?+
Event ID 4906 indicates that an application or service has attempted to register itself as a security event source in the Windows Event Log system. This registration is necessary for any component that wants to write events to the Security log or establish itself as a recognized event source. The event appears as part of Windows' security auditing framework to provide visibility into which components are establishing logging capabilities on your system.
Is Event ID 4906 a security concern or normal system behavior?+
Event ID 4906 is typically normal system behavior that occurs during legitimate software installations, service startups, or when applications initialize their logging capabilities. However, it can be a security concern if unknown or suspicious processes are registering event sources, as this could indicate malware attempting to establish logging infrastructure or unauthorized software installations. The key is to investigate the process name and context to determine legitimacy.
How can I determine if an Event ID 4906 registration is legitimate or malicious?+
To determine legitimacy, examine the process name, executable path, digital signature, and timing of the registration. Legitimate registrations typically come from signed executables during known software installations or system updates. Suspicious indicators include unsigned executables, processes running from temporary directories, registrations occurring outside of installation windows, or event source names that don't match the registering application. Cross-reference the process with your software inventory and security tools.
Can I prevent unauthorized applications from registering security event sources?+
While you cannot completely prevent event source registration through standard Windows settings, you can implement monitoring and alerting to detect unauthorized registrations quickly. Use Group Policy to restrict user permissions, implement application whitelisting, and configure security software to monitor registry changes in the EventLog keys. Additionally, maintain an inventory of approved event sources and regularly audit new registrations against this baseline.
What should I do if I find suspicious Event ID 4906 entries in my environment?+
If you discover suspicious Event ID 4906 entries, immediately investigate the associated process and executable file. Check the digital signature, scan the file with updated antivirus software, and examine the registry entries created by the registration. Isolate affected systems if malware is suspected, review recent software installations or changes, and check for other indicators of compromise. Document your findings and consider implementing additional monitoring for similar future events.
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...