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 28-4 contains
all of the DirectorySearcher properties.
Table 28-4. DirectorySearcher properties
|
Property name |
Description |
|---|---|
|
CacheResults |
Gets or sets the flag that determines whether results are cached on the client. |
|
ClientTimeout |
Gets or sets the time period the client is willing to wait for the server to answer the search. |
|
Filter |
Gets or sets the search filter string. |
|
PageSize |
Gets or sets the page size for paged searching. |
|
PropertiesToLoad |
Gets or sets the attributes to return from a search. |
|
PropertyNamesOnly |
Gets or sets the flag indicating to only return attribute names from a search. |
|
ReferralChasing |
Gets or sets whether referrals are chased. |
|
SearchRoot |
Gets or sets the base from which the search should start. |
|
SearchScope |
Gets or sets the scope of the search. |
|
ServerPageTimeLimit |
Gets or sets the time the server will wait for an individual page to return from a search. |
|
ServerTimeLimit |
Gets or sets the time the server will wait for a search to complete. |
|
SizeLimit |
Gets or sets the maximum number of objects that can be returned by a search. |
|
Sort |
Gets or sets the attribute that is used when returning sorted search results. |
Many of the properties, such as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access