FileSystemSecurity.AuditRuleFactory Method

Definition

Initializes a new instance of the FileSystemAuditRule class representing the specified audit rule for the specified user.

public:
 override System::Security::AccessControl::AuditRule ^ AuditRuleFactory(System::Security::Principal::IdentityReference ^ identityReference, int accessMask, bool isInherited, System::Security::AccessControl::InheritanceFlags inheritanceFlags, System::Security::AccessControl::PropagationFlags propagationFlags, System::Security::AccessControl::AuditFlags flags);
public override sealed System.Security.AccessControl.AuditRule AuditRuleFactory (System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.AuditFlags flags);
override this.AuditRuleFactory : System.Security.Principal.IdentityReference * int * bool * System.Security.AccessControl.InheritanceFlags * System.Security.AccessControl.PropagationFlags * System.Security.AccessControl.AuditFlags -> System.Security.AccessControl.AuditRule
Public Overrides NotOverridable Function AuditRuleFactory (identityReference As IdentityReference, accessMask As Integer, isInherited As Boolean, inheritanceFlags As InheritanceFlags, propagationFlags As PropagationFlags, flags As AuditFlags) As AuditRule

Parameters

identityReference
IdentityReference

An IdentityReference object that represents a user account.

accessMask
Int32

An integer that specifies an access type.

isInherited
Boolean

true if the access rule is inherited; otherwise, false.

inheritanceFlags
InheritanceFlags

One of the InheritanceFlags values that specifies how to propagate access masks to child objects.

propagationFlags
PropagationFlags

One of the PropagationFlags values that specifies how to propagate Access Control Entries (ACEs) to child objects.

flags
AuditFlags

One of the AuditFlags values that specifies the type of auditing to perform.

Returns

A new FileSystemAuditRule object representing the specified audit rule for the specified user.

Exceptions

The accessMask, inheritanceFlags, propagationFlags, or flags properties specify an invalid value.

The identityReference property is null.

-or-

The accessMask property is zero.

The identityReference property is neither of type SecurityIdentifier, nor of a type such as NTAccount that can be converted to type SecurityIdentifier.

Remarks

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.

Applies to