FileSystemSecurity::AuditRuleFactory Method (IdentityReference^, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags)
Initializes a new instance of the FileSystemAuditRule class representing the specified audit rule for the specified user.
Assembly: mscorlib (in mscorlib.dll)
public: virtual AuditRule^ AuditRuleFactory( IdentityReference^ identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags ) override sealed
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::AuditRule^A 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.
Available since 2.0