FileSystemSecurity.AuditRuleFactory Method
Initializes a new instance of the FileSystemAuditRule class representing the specified audit rule for the specified user.
Assembly: mscorlib (in mscorlib.dll)
public override sealed AuditRule AuditRuleFactory( IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags )
Parameters
- identityReference
- Type: System.Security.Principal.IdentityReference
An IdentityReference object that represents a user account.
- accessMask
- Type: System.Int32
An integer that specifies an access type.
- isInherited
- Type: System.Boolean
true if the access rule is inherited; otherwise, false.
- inheritanceFlags
- Type: System.Security.AccessControl.InheritanceFlags
One of the InheritanceFlags values that specifies how to propagate access masks to child objects.
- propagationFlags
- Type: System.Security.AccessControl.PropagationFlags
One of the PropagationFlags values that specifies how to propagate Access Control Entries (ACEs) to child objects.
- flags
- Type: System.Security.AccessControl.AuditFlags
One of the AuditFlags values that specifies the type of auditing to perform.
Return Value
Type: System.Security.AccessControl.AuditRuleA new FileSystemAuditRule object representing the specified audit rule for the specified user.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException |
The accessMask, inheritanceFlags, propagationFlags, or flags properties specify an invalid value. |
| ArgumentNullException |
The identityReference property is null. -or- The accessMask property is zero. |
| ArgumentException |
The identityReference property is neither of type SecurityIdentifier, nor of a type such as NTAccount that can be converted to type SecurityIdentifier. |
The recommended way to create audit rules is to use the constructors of the FileSystemAuditRule class.
The return type of the AuditRuleFactory method is the base class, AuditRule, but the return value can be cast safely to the derived class.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.