This documentation is archived and is not being maintained.
PrincipalSearcher Class
Visual Studio 2010
Encapsulates the methods and search patterns used to execute a query against the underlying principal store.
Assembly: System.DirectoryServices.AccountManagement (in System.DirectoryServices.AccountManagement.dll)
The PrincipalSearcher type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | PrincipalSearcher() | Initializes a new instance of the PrincipalSearcher class. The QueryFilter property must be set before the Principal searcher object can be used to perform a search. |
![]() | PrincipalSearcher(Principal) | Initializes a new instance of the PrincipalSearcher class with the specified query filter. |
| Name | Description | |
|---|---|---|
![]() | Context | Gets that principal context that is used to perform the query. The context specifies the server or domain against which search operations are performed. |
![]() | QueryFilter | Gets or sets the query filter that is used to locate matching principals. |
| Name | Description | |
|---|---|---|
![]() | Dispose | Disposes the current instance of the PrincipalSearcher 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.) |
![]() | FindAll | Returns a principal search result that contains a collection of all the principal objects that match the principal specified in the query filter property. |
![]() | FindOne | Returns a principal search result that contains the first principal object found that matches the principal specified in the QueryFilter property. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetUnderlyingSearcher | Returns the underlying search object that is used by the Account Management API to perform the search. |
![]() | GetUnderlyingSearcherType | Returns the type of the object returned from the GetUnderlyingSearcher method. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The default page size of 256 KB is used when the PrincipalSearcher class performs a query for domain principals. The application may override the default value by setting the PageSize property in the underlying DirectorySearcher object that is returned from the GetUnderlyingSearcher method.
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:
