Active Directory · Troubleshooting

SYSVOL Permissions Inconsistent with Active Directory After a Domain Controller Restore

When restoring a domain controller or rebuilding SYSVOL, broken NTFS inheritance and stripped Access Control Lists desynchronise the Group Policy Template from the directory, triggering GPMC inconsistency warnings and widespread Event ID 1058 policy failures across the enterprise.

By K Shankar R Karanth Active Directory Troubleshooting Homelab-tested — Windows Server 2025, DFL 2025
Quick idea: Group Policy Objects live in two separate places: the Group Policy Container in Active Directory LDAP and the Group Policy Template on the SYSVOL file share. If a backup restoration or file-level recovery alters NTFS inheritance or strips security descriptors on the SYSVOL folder, the Group Policy Management Console flags the policy as inconsistent and clients abort policy processing with Access Denied errors.
GPC vs GPT

Group Policy Container stores policy metadata and core permissions in LDAP; Group Policy Template stores actual settings and scripts in SYSVOL.

Inheritance Trap

Active Directory expects each GPO folder in SYSVOL to block inheritance. Restoring folders with parent inheritance enabled triggers instant inconsistency alerts.

MS16-072 Requirement

Clients retrieve computer and user policies under the computer’s machine account context. Missing Read rights for Domain Computers halts processing.

Introduction

It is 3:15 AM on a Sunday, and you have just completed what appeared to be a textbook system state recovery of an essential domain controller following a catastrophic hypervisor storage failure. Active Directory database replication has converged, directory partitions report healthy status via repadmin, and Kerberos ticket-granting requests are clearing cleanly across all subnets. But by 8:00 AM, the enterprise service desk queue explodes: hundreds of workstations across remote sites cannot map departmental drives, automated security baselines have failed to apply, and member servers are dumping Event ID 1058 into their System logs every ninety minutes. When you launch the Group Policy Management Console to inspect the environment, selecting any policy immediately halts your workflow with a modal dialogue box: “The permissions for this GPO in the SYSVOL folder are inconsistent with those in Active Directory.”

Think of Group Policy as a municipal deeds registry. The Group Policy Container in Active Directory acts as the central registry ledger, recording who owns the deed, when it was drafted, and who is authorised to execute it. The Group Policy Template in SYSVOL is the physical document vault holding the signed contracts, blueprints, and execution scripts. If a disaster recovery procedure rebuilds the vault using standard commercial file-copy tools, the security guard at the door might slap generic corporate padlock permissions across every document cabinet. The central registry ledger still lists the valid rules, but when client machines walk up to the vault to read the blueprints, the guard turns them away at the threshold.

This failure mode rarely stems from corrupted policy files or broken directory objects. Instead, it occurs because standard file-level restoration agents, hypervisor snapshot rollbacks, or non-authoritative replication reseeds routinely fail to preserve the exacting security descriptors, ownership attributes, and blocked inheritance flags that Active Directory requires on the SYSVOL file structure. Resolving this issue across a production domain requires understanding how the directory validates consistency, auditing file system access control lists against directory metadata, and systematically rebuilding permissions without destroying customised security filtering.

What the Error Looks Like

The primary operational symptom manifests immediately upon opening the Group Policy Management Console (gpmc.msc). When an administrator highlights any affected Group Policy Object in the navigation tree, GPMC detects the security discrepancy between LDAP and SMB, generating an urgent modal alert:

GPMC Console Warning: The permissions for this GPO in the SYSVOL folder are inconsistent with those in Active Directory. It is recommended that these permissions be consistent. To change the SYSVOL permissions to those in Active Directory, click OK.

If the administrative account inspecting the policy lacks explicit permissions to modify security descriptors on that specific GPO, the console provides an alternative variant: “The permissions for this GPO in the SYSVOL folder are inconsistent with those in Active Directory. It is recommended that these permissions be consistent. Contact an administrator who has rights to modify security on this GPO.”

On domain member servers and client workstations attempting to evaluate the policy during startup or periodic background refresh, the failure surfaces as an unhandled Access Denied condition in the Windows System event log under source Microsoft-Windows-GroupPolicy:

Log Name:      System
Source:        Microsoft-Windows-GroupPolicy
Date:          2026-10-24 08:14:22
Event ID:      1058
Task Category: None
Level:         Error
Keywords:      
User:          NT AUTHORITY\SYSTEM
Computer:      WKS-LON-042.corp.example.com
Description:
The processing of Group Policy failed. Windows attempted to read the file \\corp.example.com\SysVol\corp.example.com\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\gpt.ini from a domain controller and was not successful. Group Policy settings may not be applied until this event is resolved. This event may be transient and could be caused by one or more of the following:
a) Name Resolution/Network Connectivity to the current domain controller.
b) File Replication Service Latency (a file created on another domain controller has not replicated to the current domain controller).
c) The Distributed File System (DFS) client has been disabled.
Error Code: 5
Error Description: Access is denied.

In many environments, Event ID 1058 is accompanied by Event ID 1030, indicating that the client machine could not even establish initial policy queries against the domain controller:

Log Name:      System
Source:        Microsoft-Windows-GroupPolicy
Date:          2026-10-24 08:14:22
Event ID:      1030
Task Category: None
Level:         Error
User:          NT AUTHORITY\SYSTEM
Computer:      WKS-LON-042.corp.example.com
Description:
The processing of Group Policy failed. Windows could not determine the computer and user name. (Access is denied. ). Group Policy processing aborted.

When an engineer investigates on the client workstation by executing gpresult /h report.html or running the command-line equivalent, the resultant set of policy output confirms that policy application was aborted mid-flight due to file system permission barriers:

# Command: gpupdate /force
Updating policy...

Computer Policy update has completed successfully.
User Policy could not be updated successfully. The following errors were encountered:

The processing of Group Policy failed. Windows attempted to read the file \\corp.example.com\SysVol\corp.example.com\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\gpt.ini from a domain controller and was not successful.
Error Code: 5 (Access is denied).

To diagnose the failure, review the event log or run GPRESULT /H GPReport.html from the command line.

Finally, if you inspect the raw file system permissions on the restored domain controller using icacls, the underlying discrepancy becomes unmistakable. Instead of explicit, non-inherited access control entries defined for the GPO, the folder displays inherited permissions from the parent Policies directory or has stripped standard reading groups entirely:

# Inspecting permissions on the Default Domain Policy GPT folder
C:\> icacls "C:\Windows\SYSVOL\domain\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}"
C:\Windows\SYSVOL\domain\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9} NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
                                                                          BUILTIN\Administrators:(I)(OI)(CI)(F)
                                                                          CORP\Domain Admins:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files

Notice the (I) flag on every entry: the folder is inheriting its permissions from the parent container rather than maintaining its own independent Access Control List, and the mandatory NT AUTHORITY\Authenticated Users or Domain Computers groups are completely absent.

What It Actually Means

To understand why permissions fall out of synchronisation, one must examine the split architecture of Active Directory Group Policy. Every Group Policy Object is not a single entity, but a composite construct split across two distinct storage subsystems:

Component Storage Mechanism Path / Distinguished Name Primary Contents
Group Policy Container (GPC) Active Directory LDAP Database CN={GUID},CN=Policies,CN=System,DC=corp,DC=example,DC=com Version number, status flags, extension GUIDs, and authoritative security descriptor (ACL).
Group Policy Template (GPT) NTFS / ReFS File System (SYSVOL Share) \\corp.example.com\SYSVOL\corp.example.com\Policies\{GUID}\ gpt.ini, Administrative Templates, registry settings, security INF files, and scripts.

When an administrator configures permissions, security filtering, or delegation in GPMC, the console writes the authoritative access control rules directly to the nTSecurityDescriptor attribute of the Group Policy Container in LDAP. Simultaneously, GPMC translates those directory permissions into corresponding Windows file system Access Control Entries (ACEs) and applies them directly to the matching `{GUID}` folder inside SYSVOL.

Under normal operations, Microsoft enforces a strict structural requirement defined in Knowledge Base article KB2838154: each GPO template folder inside SYSVOL must block permission inheritance from its parent directory. The `{GUID}` folder must possess an explicit security descriptor. If inheritance is enabled on the `{GUID}` folder, or if an administrator modifies the NTFS permissions directly using Windows Explorer without updating the directory object, GPMC compares the security descriptor in LDAP with the NTFS Discretionary Access Control List (DACL) over SMB. The moment it detects that the file system is inheriting permissions, or that trustees and access masks diverge, GPMC generates the consistency warning.

During a domain controller disaster recovery or system state restoration, several factors reliably destroy this synchronisation:

1. File-level backup and restoration agents stripping extended attributes: Many enterprise backup applications treat the SYSVOL folder tree as a standard volume share rather than directory-integrated infrastructure. When performing a file restore, these tools frequently apply the destination folder’s default inheritance flags, stripping the explicit DACLs and re-enabling inheritance across every `{GUID}` subfolder.

2. Robocopy or manual data migration without security preservation flags: If an administrator manually copies policy data from a surviving domain controller or backup staging volume using utilities like robocopy without specifying /COPYALL (or /COPY:DATSOU) combined with /SECFIX and /B, Robocopy copies raw file contents but fails to enforce identical security descriptors on pre-existing target directories.

3. The MS16-072 (KB3163622) Security Context Enforcement: Historically, Windows evaluated user-targeted Group Policy settings under the interactive security context of the logged-on user. In June 2016, Microsoft patched a critical elevation of privilege vulnerability (CVE-2016-3223) by altering the Group Policy retrieval architecture. Client machines now retrieve all Group Policy files—including user policies—under the computer’s security context (NT AUTHORITY\SYSTEM). If a restored SYSVOL lacks read permissions for Authenticated Users or Domain Computers, the client computer is denied access when querying gpt.ini, aborting policy evaluation before user-level settings can even be read.

4. Machine-local SID corruption: If a domain controller is restored from a raw disk image or virtual machine snapshot that was promoted independently, local file system ownership can become tied to non-existent local security identifiers (SIDs). When member computers attempt to negotiate access, the domain controller cannot resolve the local trustees, returning immediate STATUS_ACCESS_DENIED errors.

Important: Clicking “OK” on the GPMC inconsistency dialogue box fixes the issue for that single selected GPO by re-applying the GPC security descriptor down to the SYSVOL folder. However, in an enterprise with several hundred GPOs, manually clicking “OK” across every policy is neither scalable nor practical during an active incident.

How to Diagnose

Troubleshooting SYSVOL permission inconsistencies requires a disciplined, ordered diagnostic process. Never execute blind permission resets against the entire SYSVOL share without first determining whether the issue is isolated to network transport, parent folder inheritance, or specific policy containers.

Step 1: Enumerate Inconsistent GPOs and Failing GUIDs

Begin by inspecting the System event log on an affected member server or domain controller to identify which specific policy GUIDs are generating Event ID 1058 failures. Once you have the GUID, query Active Directory to resolve it into its human-readable display name:

# Query the most recent Group Policy failures from the local event log
Get-WinEvent -FilterHashtable @{LogName='System'; ProviderName='Microsoft-Windows-GroupPolicy'; Id=1058} -MaxEvents 5 |
  Select-Object TimeCreated, Message | Format-List

# Extract the offending GUID from the error path and map it to the friendly GPO display name
$FailedGuid = "{31B2F340-016D-11D2-945F-00C04FB984F9}"
Get-GPO -Guid $FailedGuid | Select-Object DisplayName, Id, GpoStatus, ModificationTime

If the GUID corresponds to {31B2F340-016D-11D2-945F-00C04FB984F9}, you are dealing with the Default Domain Policy. If it corresponds to {6AC1786C-016F-11D2-945F-00C04FB984F9}, it is the Default Domain Controllers Policy. Any other GUID represents a custom policy created by your organisation.

Step 2: Verify Network Ports & Firewall Reachability

Before diagnosing NTFS access control lists, verify that client workstations can reach all requisite directory and file services on the restored domain controller. If firewall rules or IPsec filtering block the Server Message Block (SMB) protocol or Remote Procedure Call (RPC) endpoint mappers, the client operating system will report an Access Denied error that masquerades as an NTFS permissions failure.

The table below details the mandatory network ports required for Group Policy discovery, directory queries, and template file downloads:

Port Protocol Direction Purpose Service
445 TCP Inbound to DC SYSVOL folder traversal and gpt.ini retrieval Server Message Block (SMB)
135 TCP Inbound to DC RPC Endpoint Mapper for policy queries RPCSS
389 TCP / UDP Inbound to DC Group Policy Container LDAP queries and searches Active Directory LDAP
88 TCP / UDP Inbound to DC Kerberos ticket acquisition and authentication Kerberos KDC
49152–65535 TCP Inbound to DC Dynamic high ports for RPC policy processing RPC Dynamic Ports

Execute the following PowerShell block from a failing member workstation to validate network reachability against the restored domain controller:

# Test all mandatory Group Policy communication ports against the target DC
$TargetDC = "DC01.corp.example.com"
$RequiredPorts = @(88, 135, 389, 445)

foreach ($Port in $RequiredPorts) {
    $Test = Test-NetConnection -ComputerName $TargetDC -Port $Port -WarningAction SilentlyContinue
    [PSCustomObject]@{
        ComputerName = $TargetDC
        Port         = $Port
        PortOpen     = $Test.TcpTestSucceeded
    }
}

If port 445 returns False, the client cannot establish an SMB session to read SYSVOL, regardless of NTFS permissions. Investigate the host firewall on the restored domain controller using Get-NetFirewallRule -DisplayGroup "File and Printer Sharing" before proceeding.

Step 3: Audit SYSVOL Root and Policies Directory Permissions

Log on directly to the restored domain controller and inspect the Access Control Lists on the parent SYSVOL directories. In a default Active Directory deployment, the directory hierarchy sits at C:\Windows\SYSVOL\sysvol\<domain> (or C:\Windows\SYSVOL\domain, which is an NTFS junction point).

# Check NTFS permissions on the root SYSVOL domain folder
icacls "C:\Windows\SYSVOL\domain"

# Check NTFS permissions on the Policies container
icacls "C:\Windows\SYSVOL\domain\Policies"

The root SYSVOL\domain directory and its immediate child Policies must possess specific baseline permissions. In a healthy deployment, these permissions conform to the following standards:

Security Principal Inheritance Access Rights Operational Purpose
NT AUTHORITY\SYSTEM (OI)(CI) Full Control (F) Operating system services, backup, and local processing.
BUILTIN\Administrators (OI)(CI) Full Control (F) Domain Controller local administrative group management.
CORP\Domain Admins (OI)(CI) Full Control (F) Centralised enterprise Group Policy administration.
CORP\Enterprise Admins (OI)(CI) Full Control (F) Forest-wide administrative policy configuration.
NT AUTHORITY\Authenticated Users (OI)(CI) Read & Execute (RX) Allows all domain-joined computers and users to read policies.
CORP\Enterprise Domain Controllers (OI)(CI) Read & Execute (RX) Enables inter-DC directory and SYSVOL synchronisation.
BUILTIN\Server Operators (OI)(CI) Read & Execute (RX) Legacy operational management access.
Key point: While the Policies folder itself inherits permissions from the root SYSVOL folder, individual policy folders underneath (e.g. Policies\{GUID}) must not inherit. They must have inheritance disabled so that custom delegation and security filtering apply accurately.

Step 4: Compare GPC (LDAP) and GPT (SYSVOL) Access Control Lists

To determine why GPMC is alerting on a specific policy, compare the security descriptor on the Active Directory container object directly against the NTFS permissions on the file share:

# Import the ActiveDirectory module to inspect the Group Policy Container
Import-Module ActiveDirectory

$GpoGuid = "{31B2F340-016D-11D2-945F-00C04FB984F9}"
$DomainDN = (Get-ADDomain).DistinguishedName
$GpcPath  = "AD:CN=$GpoGuid,CN=Policies,CN=System,$DomainDN"
$GptPath  = "\\$($env:USERDNSDOMAIN)\sysvol\$($env:USERDNSDOMAIN)\Policies\$GpoGuid"

# Retrieve Active Directory GPC Access Rules
$GpcAcl = (Get-Acl -Path $GpcPath).Access |
  Select-Object IdentityReference, ActiveDirectoryRights, AccessControlType

# Retrieve File System GPT Access Rules
$GptAcl = (Get-Acl -Path $GptPath).Access |
  Select-Object IdentityReference, FileSystemRights, AccessControlType, IsInherited

# Display the comparison
Write-Host "--- GPC (Active Directory LDAP) Permissions ---" -ForegroundColor Cyan
$GpcAcl | Format-Table -AutoSize

Write-Host "--- GPT (SYSVOL NTFS) Permissions ---" -ForegroundColor Yellow
$GptAcl | Format-Table -AutoSize

If the output reveals that IsInherited is True for the GPT folder, or if trustees like NT AUTHORITY\Authenticated Users appear in the GPC table but are missing from the GPT table, you have identified the exact cause of the inconsistency.

Step 5: Test Client Access Context via PsExec

Because member workstations evaluate Group Policy under the machine account (NT AUTHORITY\SYSTEM) rather than your logged-on administrator account, testing file access in File Explorer from your administrative desktop will give a false sense of security. An administrator can read the file, but the machine cannot.

To test the exact execution path experienced by the Group Policy engine, launch an elevated command prompt on an affected client and run Sysinternals psexec to spawn an interactive shell running as local SYSTEM:

# Launch an interactive SYSTEM prompt on the client workstation
psexec.exe -s -i cmd.exe

# From the new SYSTEM command prompt, verify the current identity
whoami

# Attempt to read the gpt.ini file across the network as the machine account
type "\\corp.example.com\sysvol\corp.example.com\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\gpt.ini"

If this command yields Access is denied while your interactive user account can browse the folder without issue, you have confirmed that the machine account lacks read rights on the restored SYSVOL share.

Common Causes

Every SYSVOL inconsistency error traces back to a specific breakdown during backup extraction, directory replication, or network transport. Use the reference matrix below to identify the root cause based on observable indicators:

Cause How to Confirm Fix
Re-enabled NTFS inheritance on GPT `{GUID}` folders Get-Acl on the GPO folder reveals IsInherited = True across all access control entries; GPMC flags inconsistency on click. Block inheritance on the folder and restore explicit access control entries: icacls "C:\Windows\SYSVOL\domain\Policies\{GUID}" /inheritance:d.
Missing Read rights for Authenticated Users or Domain Computers (MS16-072) Event ID 1058 logged with Error Code 5 (Access Denied); machine cannot read gpt.ini via PsExec SYSTEM prompt. Grant read permissions to the Authenticated Users group: Set-GPPermission -Guid $Guid -TargetName "Authenticated Users" -TargetType Group -PermissionLevel GpoRead.
Stripped permissions on SYSVOL root or Policies parent directory Clients cannot traverse \\domain\SYSVOL; Event ID 1030 logged during initial directory binding. Rebuild root access rights using icacls: icacls "C:\Windows\SYSVOL\domain" /grant "NT AUTHORITY\Authenticated Users":(OI)(CI)(RX).
Host firewall blocking SMB port 445 or RPC traffic Test-NetConnection -Port 445 fails against the restored DC; Event ID 1058 reports network connectivity failure. Enable the built-in file sharing firewall rules: Enable-NetFirewallRule -DisplayGroup "File and Printer Sharing".
Orphaned or unresolved local machine SIDs icacls displays raw unresolved SID strings (such as S-1-5-21-...) rather than recognised domain groups. Take ownership of the folder structure and reassign domain administrators: takeown /f "C:\Windows\SYSVOL\domain" /r /d y.
Default Domain Policy or Default DC Policy corruption Both default policies show corrupted security descriptors; GPMC reports schema or version mismatch. Restore default policies using the recovery utility: dcgpofix /target:both.
DFSR replication backlog preventing permission propagation Permissions are correct on the restored DC but fail on replica DCs; Get-DfsrBacklog shows pending files. Force DFSR directory polling and replication updates: dfsrdiag pollad.

The Fix: Step-by-Step Recovery

Remediating SYSVOL permissions across an enterprise domain controller requires a phased approach: first stabilise the container root, then recover the baseline default policies, and finally execute an automated synchronisation script to align all custom GPOs with Active Directory.

Phase 1: Re-establish Baseline Root SYSVOL Permissions

If the restoration damaged the permissions on the root SYSVOL structure or the Policies parent folder, execute the following commands from an elevated command prompt on the restored domain controller. These commands re-establish correct ownership and apply the baseline access control entries required for directory operations:

# Step 1: Take administrative ownership of the root SYSVOL domain folder recursively
takeown /f "C:\Windows\SYSVOL\domain" /a /r /d y

# Step 2: Ensure inheritance is enabled on the root domain folder from its system container
icacls "C:\Windows\SYSVOL\domain" /inheritance:e

# Step 3: Grant explicit Full Control to SYSTEM and Domain Administrators
icacls "C:\Windows\SYSVOL\domain" /grant "NT AUTHORITY\SYSTEM":(OI)(CI)(F)
icacls "C:\Windows\SYSVOL\domain" /grant "BUILTIN\Administrators":(OI)(CI)(F)
icacls "C:\Windows\SYSVOL\domain" /grant "CORP\Domain Admins":(OI)(CI)(F)
icacls "C:\Windows\SYSVOL\domain" /grant "CORP\Enterprise Admins":(OI)(CI)(F)

# Step 4: Grant Read & Execute to Authenticated Users and Enterprise Domain Controllers
icacls "C:\Windows\SYSVOL\domain" /grant "NT AUTHORITY\Authenticated Users":(OI)(CI)(RX)
icacls "C:\Windows\SYSVOL\domain" /grant "CORP\Enterprise Domain Controllers":(OI)(CI)(RX)
icacls "C:\Windows\SYSVOL\domain" /grant "BUILTIN\Server Operators":(OI)(CI)(RX)

# Step 5: Verify permissions on the Policies child container
icacls "C:\Windows\SYSVOL\domain\Policies" /grant "NT AUTHORITY\Authenticated Users":(OI)(CI)(RX)
Troubleshooting note: Replace CORP in the commands above with your actual NetBIOS domain name. If your domain controller uses localised operating system language packs, replace English built-in group names (such as BUILTIN\Administrators) with their respective localised equivalents or use their well-known SIDs.

Phase 2: Repair Default Domain and Default Domain Controllers Policies

If the Default Domain Policy (`{31B2F340-016D-11D2-945F-00C04FB984F9}`) or Default Domain Controllers Policy (`{6AC1786C-016F-11D2-945F-00C04FB984F9}`) suffered severe permission corruption during the restore, Microsoft provides a dedicated command-line disaster recovery utility: dcgpofix.

The dcgpofix utility recreates the core Active Directory objects and file system templates for these two fundamental policies, resetting their security descriptors to factory defaults.

# Recreate both default policies and restore their default security descriptors
dcgpofix /target:both

When prompted with warnings stating that custom settings will be lost, enter Y to proceed.

Production note: Executing dcgpofix wipes all custom modifications made to the default policies, including password complexity rules, Kerberos ticket lifetimes, and User Rights Assignments on domain controllers. Only use dcgpofix if the default policies cannot be repaired through standard permission synchronisation. If you run it, re-apply your organisation’s custom password policies immediately afterward.

Phase 3: Automated Domain-Wide GPO ACL Synchronisation Script

For all other custom Group Policy Objects across the domain, manually opening GPMC and clicking “OK” across dozens or hundreds of policies is untenable. Furthermore, attempting to manually run icacls across every folder risks stripping custom delegation rules that delegate permissions to departmental administrators.

The production script below automates this repair. It iterates through every GPO in the domain, checks the corresponding folder inside SYSVOL, disables NTFS inheritance (copying existing entries to explicit rules), and uses the native Group Policy Management API to force a clean synchronisation between the Group Policy Container and the Group Policy Template:

#=============================================================================
# Script: Sync-GpoSysvolPermissions.ps1
# Purpose: Automatically detects and fixes SYSVOL permission inconsistencies
#          across all Group Policy Objects in the domain.
# Run on: Primary Domain Controller (PDC Emulator) with elevated privileges
#=============================================================================
[CmdletBinding()]
param(
    [string]$DomainName = $env:USERDNSDOMAIN
)

Import-Module GroupPolicy -ErrorAction Stop
Import-Module ActiveDirectory -ErrorAction Stop

Write-Host "Starting domain-wide SYSVOL permission synchronization for: $DomainName" -ForegroundColor Cyan

# Retrieve all GPOs in the target domain
$AllGPOs = Get-GPO -All -Domain $DomainName
Write-Host "Discovered $($AllGPOs.Count) Group Policy Objects. Evaluating consistency..." -ForegroundColor Green

$FixedCount = 0
$CleanCount = 0

foreach ($Gpo in $AllGPOs) {
    $Guid = $Gpo.Id.ToString("B").ToUpper()
    $SysvolGpoPath = "\\$DomainName\sysvol\$DomainName\Policies\$Guid"

    if (-not (Test-Path -LiteralPath $SysvolGpoPath)) {
        Write-Warning "GPT folder missing on SYSVOL for GPO '$($Gpo.DisplayName)' ($Guid). Skipping."
        continue
    }

    # Inspect current NTFS inheritance state
    $Acl = Get-Acl -LiteralPath $SysvolGpoPath
    $NeedsFix = $false

    # Check if inheritance is incorrectly enabled on the GPO folder
    if ($Acl.AreAccessRulesProtected -eq $false) {
        Write-Host "[-] GPO '$($Gpo.DisplayName)' has inheritance ENABLED on SYSVOL. Fixing..." -ForegroundColor Yellow
        $NeedsFix = $true
    }

    # Verify if Authenticated Users has Read access (MS16-072 compliance)
    $AuthUsersAce = $Acl.Access | Where-Object {
        $_.IdentityReference.Value -like "*Authenticated Users" -and
        $_.FileSystemRights -band [System.Security.AccessControl.FileSystemRights]::Read
    }

    if (-not $AuthUsersAce) {
        Write-Host "[-] GPO '$($Gpo.DisplayName)' is missing Authenticated Users Read access. Fixing..." -ForegroundColor Yellow
        $NeedsFix = $true
    }

    if ($NeedsFix) {
        try {
            # 1. Disable inheritance and preserve existing explicit rules
            $Acl.SetAccessRuleProtection($true, $true)
            Set-Acl -LiteralPath $SysvolGpoPath -AclObject $Acl

            # 2. Re-assert baseline Authenticated Users Read rights via Set-GPPermission
            # This triggers GPMC's underlying COM engine to synchronise GPC and GPT security descriptors
            Set-GPPermission -Guid $Gpo.Id -TargetName "Authenticated Users" `
                             -TargetType Group -PermissionLevel GpoRead `
                             -DomainName $DomainName -Replace -ErrorAction Stop | Out-Null

            Write-Host "[+] Successfully synchronised: $($Gpo.DisplayName)" -ForegroundColor Green
            $FixedCount++
        }
        catch {
            Write-Error "Failed to update permissions on GPO '$($Gpo.DisplayName)': $_"
        }
    }
    else {
        $CleanCount++
    }
}

Write-Host "`nSynchronization complete." -ForegroundColor Cyan
Write-Host "Clean GPOs: $CleanCount | Remediated GPOs: $FixedCount" -ForegroundColor White

This script performs two critical operations: it sets SetAccessRuleProtection($true, $true), which disables file inheritance while converting inherited permissions to explicit rules (preventing accidental lockouts), and then executes Set-GPPermission -Replace, which forces the underlying GPMC engine to rebuild the directory-to-file security mapping.

Phase 4: Forcing DFSR SYSVOL Synchronisation

Once permissions are repaired on the domain controller hosting the PDC emulator role, force the Distributed File System Replication (DFSR) service to poll Active Directory and propagate the updated security descriptors to all other domain controllers:

# Force DFSR to immediately poll Active Directory for configuration updates
dfsrdiag pollad

# Check for pending replication backlogs between domain controllers
Get-DfsrBacklog -SourceComputerName "DC01" -DestinationComputerName "DC02" `
                -GroupName "Domain System Volume" -FolderName "SYSVOL Share"

Monitor the DFS Replication event log in Event Viewer on secondary domain controllers. Confirm that Event ID 4604 appears, indicating that the DFS Replication service successfully initialised the SYSVOL replicated folder and that data is converging cleanly.

Phase 5: Client-Side Validation

Return to the affected member workstation that previously recorded Event ID 1058 errors. Execute a forced policy refresh and inspect the resultant set of policy to confirm that the Access Denied condition is fully resolved:

# Force an immediate background and foreground policy refresh
gpupdate /force

# Verify that both Computer and User policies applied without errors
gpresult /r /v | Select-String -Pattern "Applied Group Policy Objects" -Context 0, 10

Examine the local System event log. Event ID 1058 should no longer appear, replaced instead by Event ID 1500: “The Group Policy settings for the computer were processed successfully. There were no changes detected since the last successful processing of Group Policy.”

How to Prevent It

Preventing SYSVOL permission discrepancies requires enforcing proper architectural standards during backup, recovery, and daily operational administration.

1. Always use VSS-aware System State backups: Never rely on standard file-system backup agents or hypervisor virtual disk copies to safeguard domain controllers. Standard file copies do not coordinate with the Active Directory Volume Shadow Copy Service (VSS) writers, leading to stripped security attributes upon restore. Always execute complete Active Directory System State backups using Windows Server Backup (wbadmin) or certified enterprise backup products that understand Active Directory metadata.

2. Enforce strict Robocopy syntax when migrating SYSVOL files: If you must stage or migrate policy files manually during server replacement or disaster recovery, always execute Robocopy with parameters that preserve file security, attributes, and ownership:

# Verified Robocopy command preserving all security, ownership, and audit descriptors
robocopy "D:\SYSVOL_Backup\Policies" "C:\Windows\SYSVOL\domain\Policies" /E /COPYALL /SECFIX /B /R:1 /W:1

The /COPYALL flag (equivalent to /COPY:DATSOU) copies data, attributes, timestamps, security (NTFS ACLs), ownership, and auditing information. The /SECFIX flag is mandatory: without it, Robocopy skips security synchronisation on files that already exist in the target directory. The /B switch runs the operation in backup mode, allowing the process to override permissions if necessary.

3. Implement automated GPO consistency monitoring: Deploy a scheduled PowerShell task on your administrative management server that audits GPO inheritance and permissions on a weekly schedule. Catching a permissions drift early prevents widespread outages when policies are next modified.

4. Never modify SYSVOL permissions via Windows Explorer: Instruct system administrators never to use the file security properties tab in Windows Explorer to adjust permissions on folders inside \\domain\SYSVOL. All delegation, access adjustments, and security filtering must be managed exclusively through the Group Policy Management Console or PowerShell’s Set-GPPermission cmdlets to ensure the GPC and GPT stay aligned.

For deeper insights into Active Directory replication engines and Group Policy architecture, consult our companion guides on DFSR SYSVOL Stuck — Event 4012 and Backlog Not Clearing, Troubleshooting Group Policy Event 1058: Resolving CSE Download Failures, and Resultant Set of Policy and gpresult.

Final Thoughts

Active Directory Group Policy is remarkably resilient, but its split personality—part LDAP directory object, part SMB file hierarchy—makes it uniquely vulnerable when disaster recovery procedures treat domain controllers like ordinary file servers. An inconsistent GPO is almost never an unrecoverable failure. In the vast majority of enterprise outages, the files, templates, and directory objects are entirely intact; only the security descriptors that bind them together have slipped out of alignment.

By understanding the distinct roles of the Group Policy Container and Group Policy Template, recognising the critical necessity of disabled inheritance on template directories, and enforcing the computer security context required by MS16-072, systems engineers can turn an intimidating enterprise outage into a systematic, repeatable recovery.

Key takeaway: When GPMC warns of inconsistent SYSVOL permissions after a restore, the culprit is almost always re-enabled NTFS inheritance or stripped Authenticated Users read rights on the `{GUID}` folder. Disable inheritance, re-assert explicit access control entries, and let the Group Policy API re-align file system templates with directory metadata.
Next in this series

Next, we can explore reading and interpreting DCDIAG diagnostic output, examining what each individual test verifies and how to isolate failing directory health checks in production.


Discover more from Karanth.ovh

Subscribe to get the latest posts sent to your email.