System.Security.AccessControl.FileSystemSecurity.RemoveAuditRule Method

Removes all matching allow or deny audit rules from the current file or directory.

Syntax

public bool RemoveAuditRule (FileSystemAuditRule rule)

Parameters

rule
A System.Security.AccessControl.FileSystemAuditRule object that represents an audit rule to remove from a file or directory.

Returns

true if the audit rule was removed; otherwise, false

Remarks

The FileSystemSecurity.RemoveAuditRule(FileSystemAuditRule) method removes either all matching AccessControlType.Deny audit rules or all matching AccessControlType.Allow audit rules from the current System.Security.AccessControl.FileSystemSecurity object. For example, you can use this method to remove all AccessControlType.Deny audit rules for a user by passing a System.Security.AccessControl.FileSystemAuditRule object created using the AccessControlType.Deny value, the AuditFlags.Failure value, and a user account. When you do this, the FileSystemSecurity.RemoveAuditRule(FileSystemAuditRule) method removes any deny rules that specify the AuditFlags.Failure value or the AuditFlags.Success value.

Requirements

Namespace: System.Security.AccessControl
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0