Group Policy Object Changed Without Approval: Trace the Edit With Event 5136 and Roll Back With Restore-GPO
Overview
An unapproved edit to a Group Policy Object reaches every computer in scope at the next refresh. Record the GPO and back it up, find the editor with event 5136, restore the approved version with Restore-GPO -BackupId, then check links, which a restore never touches.
Diagnose
Symptom
What responders observe.
Use this runbook when one of these is true and no approved change explains it: Computers or users start showing a setting nobody asked for: a security option relaxed, a new startup script, a changed user right. Get-GPO shows a ModificationTime after the last approved change to that GPO.
Your monitoring raises event 5136, "A directory service object was modified", with the class groupPolicyContainer and a Subject account that does not belong to your Group Policy team. If the change turns out to be an approved one that went wrong, the same recovery steps apply, but the security escalation does not.
Detection
Metrics, logs and confirmation commands.
Find the PDC emulator and the writable domain controllers: Get-ADDomain | Select-Object PDCEmulator, ReplicaDirectoryServers The Group Policy cmdlets contact the PDC emulator unless you name a server, and GPMC targets it by default, so most edits land there. Search its Security log for modifications to Group Policy objects: Get-WinEvent -ComputerName DC01.contoso.com -FilterHashtable @{ LogName='Security'; Id=5136; StartTime=(Get-Date).AddDays(-2); ObjectClass='groupPolicyContainer' } Get-WinEvent treats a key it does not recognise, here ObjectClass, as the name of an event data field. A GPO's container in Active Directory is named with the GPO's GUID and sits under CN=Policies,CN=System, so expected: events whose Object DN contains the GPO's Id, with the Subject account, the attribute and the time. A change usually shows as two events with the same Correlation ID: "Value Deleted" with the old value, then "Value Added" with the new one. Repeat against each server in ReplicaDirectoryServers if the PDC has none. If no server has any 5136 events, auditing was not catching it.
Audit Directory Service Changes only logs on domain controllers, and only for objects whose SACL audits the write. Fall back on ModificationTime, your change records and the report comparison below, and say in the incident record that the editor is unknown. That alone is a reason to escalate. Find out what changed. Open the last approved backup in GPMC: right-click Group Policy Objects, select Manage Backups, browse to your routine backup folder and pick the latest version from before the change.
Compare its settings with C:\IR\baseline-now.html, and note its backup ID.
Check the links separately, because links belong to the site, domain or OU, not to the GPO: Get-GPInheritance -Target "OU=Workstations,DC=contoso,DC=com" GpoLinks lists the GPOs linked directly to that OU and InheritedGpoLinks the ones applied there, in precedence order. A new or re-enabled link is part of the incident even if the GPO's settings look right. If the change added a deny user right or a Restricted Groups entry, the effects on servers have their own runbooks: recovering server sign-ins after a GPO adds a deny log on right and putting back local administrators removed by a Restricted Groups GPO. flowchart TD A[GPO changed without approval] --> B[Get-GPOReport and Backup-GPO the current state] B --> C{Event 5136 for the groupPolicyContainer?} C -- Yes --> D{Subject is an approved GPO editor?} C -- No --> E[Editor unknown: escalate to security] D -- No --> E D -- Yes --> F{Approved backup from before the change?} E --> F F -- Yes --> G[Restore-GPO BackupId with WhatIf, then run] F -- No --> H[Set-GPLink LinkEnabled No and escalate to the GPO owner] G --> I[Check links with Get-GPInheritance] I --> J[gpupdate force on a pilot computer] J --> K{gpresult shows the approved settings?} K -- Yes --> L[Close and harden GPO edit rights] K -- No --> M[Restore the incident backup and escalate]
Root cause
Why the incident occurred.
Find the PDC emulator and the writable domain controllers: Get-ADDomain | Select-Object PDCEmulator, ReplicaDirectoryServers The Group Policy cmdlets contact the PDC emulator unless you name a server, and GPMC targets it by default, so most edits land there.
Search its Security log for modifications to Group Policy objects: Get-WinEvent -ComputerName DC01.contoso.com -FilterHashtable @{ LogName='Security'; Id=5136; StartTime=(Get-Date).AddDays(-2); ObjectClass='groupPolicyContainer' } Get-WinEvent treats a key it does not recognise, here ObjectClass, as the name of an event data field.
A GPO's container in Active Directory is named with the GPO's GUID and sits under CN=Policies,CN=System, so expected: events whose Object DN contains the GPO's Id, with the Subject account, the attribute and the time.
A change usually shows as two events with the same Correlation ID: "Value Deleted" with the old value, then "Value Added" with the new one.
Repeat against each server in ReplicaDirectoryServers if the PDC has none.
If no server has any 5136 events, auditing was not catching it.
Audit Directory Service Changes only logs on domain controllers, and only for objects whose SACL audits the write.
Fall back on ModificationTime, your change records and the report comparison below, and say in the incident record that the editor is unknown.
That alone is a reason to escalate.
Find out what changed.
Open the last approved backup in GPMC: right-click Group Policy Objects, select Manage Backups, browse to your routine backup folder and pick the latest version from before the change.
Compare its settings with C:\IR\baseline-now.html, and note its backup ID.
Check the links separately, because links belong to the site, domain or OU, not to the GPO: Get-GPInheritance -Target "OU=Workstations,DC=contoso,DC=com" GpoLinks lists the GPOs linked directly to that OU and InheritedGpoLinks the ones applied there, in precedence order.
A new or re-enabled link is part of the incident even if the GPO's settings look right.
If the change added a deny user right or a Restricted Groups entry, the effects on servers have their own runbooks: recovering server sign-ins after a GPO adds a deny log on right and putting back local administrators removed by a Restricted Groups GPO. flowchart TD A[GPO changed without approval] --> B[Get-GPOReport and Backup-GPO the current state] B --> C{Event 5136 for the groupPolicyContainer?} C -- Yes --> D{Subject is an approved GPO editor?} C -- No --> E[Editor unknown: escalate to security] D -- No --> E D -- Yes --> F{Approved backup from before the change?} E --> F F -- Yes --> G[Restore-GPO BackupId with WhatIf, then run] F -- No --> H[Set-GPLink LinkEnabled No and escalate to the GPO owner] G --> I[Check links with Get-GPInheritance] I --> J[gpupdate force on a pilot computer] J --> K{gpresult shows the approved settings?} K -- Yes --> L[Close and harden GPO edit rights] K -- No --> M[Restore the incident backup and escalate].
Contain and prevent
Blast radius
What else this can affect.
Prevention
Controls and guardrails that stop it recurring.
-
Back up all GPOs on a schedule with Backup-GPO -All -Path \FS01\GpoBackups, so an approved version always exists.
-
Turn on Audit Directory Service Changes on domain controllers and add a SACL that audits writes to Group Policy objects, so 5136 names the editor next time.
-
Expect high event volume.
-
Cut edit rights back to a small, named group and review them each quarter.
-
If you are moving devices off Group Policy, Group Policy Analytics shows which settings Intune can take over.
Fix
Pre-flight checks
Check these before you change anything.
The Group Policy and Active Directory PowerShell modules on an admin workstation.
Edit rights on the GPO and link rights on its OUs.
Administrator access to read the Security log on domain controllers.
An existing folder for the incident backup, separate from routine GPO backups.
Commands
Get-GPO -Name "Workstation Baseline"
Get-GPOReport -Name "Workstation Baseline" -ReportType HTML -Path C:\IR\baseline-now.html
Get-GPPermission -Name "Workstation Baseline" -All
Backup-GPO -Name "Workstation Baseline" -Path C:\IR\GpoBackups -Comment "Incident: state before rollback"
Get-ADDomain | Select-Object PDCEmulator, ReplicaDirectoryServers
Get-WinEvent -ComputerName DC01.contoso.com -FilterHashtable @{ LogName='Security'; Id=5136; StartTime=(Get-Date).AddDays(-2); ObjectClass='groupPolicyContainer' }
Get-GPInheritance -Target "OU=Workstations,DC=contoso,DC=com"
Restore-GPO -BackupId <approved-backup-id> -Path \\FS01\GpoBackups -WhatIf
Restore-GPO -BackupId <approved-backup-id> -Path \\FS01\GpoBackups
Set-GPLink -Name "Workstation Baseline" -Target "OU=Workstations,DC=contoso,DC=com" -LinkEnabled No
gpupdate /target:computer /force
gpresult /scope computer /z
Get-GPO -All | Sort-Object ModificationTime -Descending
Verify and recover
Verification
Evidence required before you close the incident.
Run Get-GPOReport for the GPO and compare with the approved backup's settings. — HTML report. — Settings and links match the approved version.
Run Get-GPPermission -Name "Workstation Baseline" -All. — Trustee list. — Only expected trustees hold edit rights.
Run gpupdate /target:computer /force and gpresult /scope computer /z on a pilot computer. — RSoP output. — The approved values apply. Search 5136 events for the GPO after the restore. — Security log on the domain controllers. — No modifications from any account other than the responder's.
Rollback
The safe way back.
Run Restore-GPO -BackupId <incident-backup-id> -Path C:\IR\GpoBackups to return the GPO to the state captured at the start, then refresh the pilot computer.
Run Set-GPLink -Name "Workstation Baseline" -Target "OU=Workstations,DC=contoso,DC=com" -LinkEnabled Yes to re-enable a link disabled during the incident.
Escalate when
Conditions that need another owner.
-
The 5136 Subject is not an approved GPO editor, or you cannot tell who made the change.
-
Get-GPPermission shows a trustee with edit rights that you did not delegate.
-
Other GPOs show a ModificationTime in the same window: run Get-GPO -All | Sort-Object ModificationTime -Descending to see them.
-
The GPO applies to domain controllers, or it is linked at the domain.
-
Hand over the incident backup ID, the reports and the events.
-
Containing the account is a security decision, not a Group Policy one.
-
Security incident lead GPO owner.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Sources
Based on the vendor sources listed below. Check each step against your environment before acting.
First published 25 November 2026
5136(S): A directory service object was modified.
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Audit Directory Service Changes
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-GPO
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-GPOReport
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Backup-GPO
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Restore-GPO
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-GPPermission
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Set-GPLink
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-GPInheritance
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
gpupdate
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
gpresult
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-WinEvent
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
GPO Operations Supported by the GPMC
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Back Up and Restore Group Policy in Windows
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
GPMC or Import-GPO cmdlet fails to restore a GPO from backup
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-ADDomain
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
[MS-GPOD]: Group Policy Structure
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Incident Response Recommendations and Considerations for Cybersecurity Risk Management
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Recommended reading
More from KBY that goes with this runbook.
Related runbooks
Local Administrators Removed From Member Servers After a Restricted Groups GPO Applies
When a Restricted Groups GPO reaches member servers with an incomplete Members list, Windows removes every unlisted member of Administrators at the next refresh. Confirm with event 4733 and gpresult, back up the GPO, then restore the known-good version or disable the link and re-add the removed members.
Server Sign-Ins Refused After a GPO Adds a Group to a Deny Log On User Right
When server sign-ins fail with event 4625 status 0xC000015B after a Group Policy change, check whether a GPO added a group to a Deny log on right, which supersedes the Allow right. Find the GPO with gpresult, back it up with Backup-GPO, restore the known-good version, refresh policy and confirm sign-in.


