This documentation is archived and is not being maintained.

SemaphoreAuditRule Constructor

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

Namespace:  System.Security.AccessControl
Assembly:  System (in System.dll)

public SemaphoreAuditRule(
	IdentityReference identity,
	SemaphoreRights eventRights,
	AuditFlags flags


Type: System.Security.Principal.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.

Type: System.Security.AccessControl.SemaphoreRights

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

Type: System.Security.AccessControl.AuditFlags

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


eventRights specifies an invalid value.


flags specifies an invalid value.


identity is null.


eventRights is zero.


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

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0