Searching with DirectorySearcher
We've shown how easy it is to read individual objects from Active Directory with the DirectoryEntry
class, so let's now look at how to search Active Directory with the DirectorySearcher
class. The DirectorySearcher
class works like many other LDAP-based search APIs. Table 31-4 contains all of the DirectorySearcher
properties.
Table 31-4. DirectorySearcher properties
Property name |
Description |
---|---|
|
Gets or sets the flag that determines whether results are cached on the client |
|
Gets or sets the time period the client is willing to wait for the server to answer the search |
|
Gets or sets the search filter string |
|
Gets or sets the page size for paged searching |
|
Gets or sets the attributes to return from a search |
|
Gets or sets the flag indicating to only return attribute names from a search |
|
Gets or sets whether referrals are chased |
|
Gets or sets the base from which the search should start |
|
Gets or sets the scope of the search |
|
Gets or sets the time the server will wait for an individual page to return from a search |
|
Gets or sets the time the server will wait for a search to complete |
|
Gets or sets the maximum number of objects that can be returned by a search |
|
Gets or sets the attribute that is used when returning sorted search results |
Many of the ...
Get Active Directory, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.