This documentation is archived and is not being maintained.
PrincipalContext Class
Visual Studio 2010
Encapsulates the server or domain against which all operations are performed, the container that is used as the base of those operations, and the credentials used to perform the operations.
Assembly: System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)
[SecurityPermissionAttribute(SecurityAction::Assert, Flags = SecurityPermissionFlag::UnmanagedCode)] [DirectoryServicesPermissionAttribute(SecurityAction::InheritanceDemand, Unrestricted = true)] [DirectoryServicesPermissionAttribute(SecurityAction::LinkDemand, Unrestricted = true)] public ref class PrincipalContext : IDisposable
The PrincipalContext type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | PrincipalContext(ContextType) | Initializes a new instance of the PrincipalContext class with the specified context type. |
![]() | PrincipalContext(ContextType, String) | Initializes a new instance of the PrincipalContext class with the specified context type and name. |
![]() | PrincipalContext(ContextType, String, String) | Initializes a new instance of the PrincipalContext class with the specified context type, name, and container. |
![]() | PrincipalContext(ContextType, String, String, ContextOptions) | Initializes a new instance of the PrincipalContext class with the specified context type, name, container, and context options. |
![]() | PrincipalContext(ContextType, String, String, String) | Initializes a new instance of the PrincipalContext class with the specified context type, name, username, and password. |
![]() | PrincipalContext(ContextType, String, String, String, String) | Initializes a new instance of the PrincipalContext class with the specified context type, name, container, username, and password. |
![]() | PrincipalContext(ContextType, String, String, ContextOptions, String, String) | Initializes a new instance of the PrincipalContext class with the specified context type, name, container, context options, username, and password. |
| Name | Description | |
|---|---|---|
![]() | ConnectedServer | Gets the name of the server to which the principal context is connected. |
![]() | Container | Gets the value specified in the container parameter in the constructor. |
![]() | ContextType | Gets the context type that specifies the type of store for the principal context. |
![]() | Name | Gets the value specified as the name parameter in the constructor. |
![]() | Options | Gets the options specified in the contextOptions parameter of the constructor. |
![]() | UserName | Gets the value specified in the username parameter in the constructor. |
| Name | Description | |
|---|---|---|
![]() | Dispose | Disposes the current instance of the PrincipalContext object. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | ValidateCredentials(String, String) | Creates the connections to the server and returns a Boolean value that specifies whether the specified username and password are valid. |
![]() | ValidateCredentials(String, String, ContextOptions) | Creates the connections to the server and returns a Boolean value that specifies whether the specified user name and password are valid. This method performs fast credential validation of the username and password. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
