UserPrincipal.Current Property

 

Gets a user principal object that represents the current user under which the thread is running.

Namespace:   System.DirectoryServices.AccountManagement
Assembly:  System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)

public static UserPrincipal Current {
	[SecurityPermissionAttribute(SecurityAction.Assert, Flags = SecurityPermissionFlag.UnmanagedCode)]
	get;
}

Property Value

Type: System.DirectoryServices.AccountManagement.UserPrincipal

A UserPrincipal representing the current user.

Exception Condition
InvalidOperationException

The underlying store does not support this property.

NoMatchingPrincipalException

The user principal object for the current user could not be found. The principal object may contain an access control list to prevent access by unauthorized users.

T:System.MultipleMatchesException

Multiple user principal objects matching the current user were found.

.NET Framework
Available since 3.5

System.DirectoryServices.AccountManagement
UserPrincipal Class
System.DirectoryServices.AccountManagement Namespace Overview

Return to top
Show: