EventWaitHandleAuditRule Constructor

Definition

Initializes a new instance of the EventWaitHandleAuditRule class, specifying the user or group to audit, the rights to audit, and whether to audit success, failure, or both.

C#
public EventWaitHandleAuditRule(System.Security.Principal.IdentityReference identity, System.Security.AccessControl.EventWaitHandleRights eventRights, System.Security.AccessControl.AuditFlags flags);

Parameters

identity
IdentityReference

The user or group the rule applies to. Must be of type SecurityIdentifier or a type such as NTAccount that can be converted to type SecurityIdentifier.

eventRights
EventWaitHandleRights

A bitwise combination of EventWaitHandleRights values specifying the kinds of access to audit.

flags
AuditFlags

A bitwise combination of AuditFlags values specifying whether to audit success, failure, or both.

Exceptions

eventRights specifies an invalid value.

-or-

flags specifies an invalid value.

identity is null.

-or-

eventRights is zero.

identity is neither of type SecurityIdentifier nor of a type such as NTAccount that can be converted to type SecurityIdentifier.

Remarks

To create an NTAccount object from a string representing a user or group name, use the NTAccount.NTAccount(String) constructor.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10