Environment
Windows 11, build 26300, NTFS.
Elevated Windows PowerShell 5.1.
SeSecurityPrivilege available in the elevated session.
Security auditing enabled for File System.
Problem
I need to restore the original SACL inheritance protection state of an existing NTFS directory without modifying its existing security entries.
Originally, the directory had:
Zero conventional audit rules.
AreAuditRulesProtected = False.
I temporarily added a successful file-write auditing rule using PowerShell Set-Acl. The audit worked: Windows generated Security Event 4663.
I then removed that specific auditing rule. The audit rule count returned to zero, but:
AreAuditRulesProtected = True
Attempting to restore inheritance with:
$acl = Get-Acl -LiteralPath $path -Audit
$acl.SetAuditRuleProtection($false, $false)
Set-Acl -LiteralPath $path -AclObject $acl
did not persist the change. A fresh read still returned True.
Investigation and reproduction
We investigated this behavior in separate, disposable NTFS laboratory directories, without attempting further modifications to the operational directory.
An extended Win32 security descriptor query revealed a SYSTEM_RESOURCE_ATTRIBUTE ACE (type 0x12, 68 bytes, flags 0x13) in a laboratory parent/child fixture. Conventional PowerShell audit-rule enumeration did not expose this ACE.
We created a controlled synthetic fixture with:
Parent SACL inheritance protection: disabled.
Child SACL inheritance protection: enabled.
Identical resource-attribute ACE sequences in both directories.
Native descriptor backups and checks of existing descendants.
We then tested:
SetSecurityInfo(handle, SE_FILE_OBJECT, UNPROTECTED_SACL_SECURITY_INFORMATION, NULL, NULL, NULL, NULL)
The call returned ERROR_SUCCESS, but the child's SE_SACL_PROTECTED flag remained set.
A subsequent independent verification confirmed that:
The child descriptor remained byte-for-byte identical to its saved baseline.
The parent descriptor remained unchanged.
The existing descendants' security and content fingerprints remained unchanged.
The operation did not achieve the requested protection-state transition. The reverse transition was therefore not tested.
The resource-attribute entries in this example are synthetic. We are not claiming that the laboratory fixture reproduces every characteristic of the operational directory.
Questions for Windows security / Win32 specialists
What is the Microsoft-supported procedure for changing SE_SACL_PROTECTED from enabled to disabled on an existing NTFS directory?
Does this require SACL_SECURITY_INFORMATION together with UNPROTECTED_SACL_SECURITY_INFORMATION and a non-null pSacl?
How can we preserve existing SYSTEM_RESOURCE_ATTRIBUTE ACEs, mandatory labels and other SACL information during this operation?
Can inheritance recalculation modify the target SACL or existing descendants even when the API reports success?
Is there a supported administrative tool or documented API sequence that allows this state to be restored safely and verified independently?
Our priority is to avoid changing the owner, group, DACL, SACL ACE contents or existing descendants unintentionally.
We would appreciate a documented procedure or guidance from a Windows security specialist before making further changes to the operational directory.
Thank you.