Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

FileSystemSecurity::AddAuditRule Method (FileSystemAuditRule)

Adds the specified audit rule to the current file or directory.

Namespace:  System.Security.AccessControl
Assembly:  mscorlib (in mscorlib.dll)
void AddAuditRule(
	FileSystemAuditRule^ rule


Type: System.Security.AccessControl::FileSystemAuditRule

A FileSystemAuditRule object that represents an audit rule to add to a file or directory.


The rule parameter is nullptr.

The AddAuditRule method adds a new audit rule to the list of rules contained within a FileSystemSecurity object.

If an audit rule already exists for the specified rule, the AddAuditRule method will still add the rule.

The following code example uses the AddAuditRule method to add an audit rule to a file and uses the RemoveAuditRule method to remove the audit rule from the file. You must supply a valid user or group account to run this example.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.