Set Audit Rule(RegistryAuditRule)
Removes all audit rules with the same user as the specified rule, regardless of the AuditFlags value, and then adds the specified rule.
public void SetAuditRule (System.Security.AccessControl.RegistryAuditRule rule);
The RegistryAuditRule to add. The user specified by this rule determines the rules to remove before this rule is added.
If there are no audit rules whose user matches the specified rule,
rule is added.