PrincipalContext Constructor (ContextType)

PrincipalContext Constructor (ContextType)

 

Initializes a new instance of the PrincipalContext class with the specified context type.

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

public PrincipalContext(
	ContextType contextType
)

Parameters

contextType
Type: System.DirectoryServices.AccountManagement.ContextType

A ContextType enumeration value specifying the type of store for the principal context.

Exception Condition
ArgumentException

A name or container must be specified when using the application directory context.

InvalidEnumArgumentException

The contextType parameter does not contain a valid ContextType enumeration value.

.NET Framework
Available since 3.5
Return to top
Show:
© 2016 Microsoft