Hi there!
I've been coding 8 hours for a little script for change the audit rules of a folder tree, and I doesn't understand yet how SetAuditRuleProtection works. This snippet is pretty simple:
$Acl = Get-Acl $Object.FullName -Audit
$Acl.SetAuditRuleProtection($false, $false)
$Acl | Set-Acl # Or $Acl | Set-Acl $Object.FullName, same behavior
This not enable the inheritance in the object $Object, why? What am I doing wrong? I am very frustrated with this :(
Even when I have the button "Disable inheritance" in the Auditing tab of the object (it means that inheritance is enabled, I think), the audit rules from parent doesn't appears until I modify this (create a rule, delete the rule [no changes at all], apply should work).
It's annoying :(
Sorry for my bad English