Event ID 5136: directory object modified
What Event ID 5136 (directory object modified) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.
Event ID 5136 records a change to an attribute of an Active Directory object, with the attribute name and the new value. Group membership has its own events, but many of the quieter persistence techniques only show up here: SPNs added for targeted Kerberoasting, shadow credentials, delegation for RBCD, and changes to AdminSDHolder or Group Policy objects.
The fields that matter
| Field | What it tells you |
|---|---|
| Subject > Account Name | Who made the change. |
| Object > DN / Class | The object changed. |
| Attribute > LDAP Display Name | The attribute, for example servicePrincipalName or msDS-KeyCredentialLink. |
| Attribute > Value | The value added or removed. |
| Operation > Type | Value Added or Value Deleted; a change shows as a delete then an add. |
| Correlation ID | Groups the deletes and adds that belong to one change. |
What is normal
Changes by identity management systems, admins editing users, and Group Policy edits by the GPO owners.
When Event ID 5136 is suspicious
servicePrincipalNameadded to a user account (targeted Kerberoasting).msDS-KeyCredentialLinkwritten outside Windows Hello for Business enrolment (shadow credentials).msDS-AllowedToActOnBehalfOfOtherIdentityset on a computer (RBCD abuse).- Any change to
CN=AdminSDHolder,CN=System,...or togPCFileSysPathon a Group Policy object.
Common false positive: Windows Hello for Business writes msDS-KeyCredentialLink during enrolment, and HR-driven identity tools change many attributes. Know the service accounts behind both.
Find Event ID 5136 with PowerShell
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=5136; StartTime=(Get-Date).AddDays(-7)} -MaxEvents 50 |
ForEach-Object {
$d = [ordered]@{ Time = $_.TimeCreated; Computer = $_.MachineName }
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]$d
} | Format-List
Microsoft Sentinel (KQL)
SecurityEvent
| where TimeGenerated > ago(7d) and EventID == 5136
| project TimeGenerated, Computer, Account, Activity, EventData
| order by TimeGenerated desc
Related events
- Event ID 4662: Operation performed on an AD object
- Event ID 4742: Computer account changed
- Event ID 4738: User account changed
- Event ID 4769: Kerberos service ticket requested
For a full walk-through, read Kerberoasting detection with Event ID 4769.
FAQ
Why don't I see 5136 events?
Audit Directory Service Changes must be enabled on domain controllers, and the objects need SACLs that audit writes. The defaults cover much of the domain, but check the OUs that matter.
Windows Event Triage reads a CSV, EVTX-to-JSON or XML export in your browser and flags brute force, new admins, suspicious services and log clearing.
IOC Triage, our free browser extension: right-click it for a verdict from 15 threat-intel sources, then copy a ready ticket note.