Principal.UserPrincipalName Property

 

Gets or sets the user principal name (UPN) associated with this principal.

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

public string UserPrincipalName {
	[SecurityCriticalAttribute]
	get;
	[SecurityCriticalAttribute]
	set;
}

Property Value

Type: System.String

The UPN associated with this principal or null if no if the UPN has not been set.

Exception Condition
T:System.Inval>DidOperationException

The underlying store does not support this property.

Setting this property to null removes the existing UPN, if one exists.

.NET Framework
Available since 3.5

System.DirectoryServices.AccountManagement
Principal Class
System.DirectoryServices.AccountManagement Namespace Overview

Return to top
Show: