1 out of 3 rated this helpful - Rate this topic

Additional Search Options 

DirectorySearcher contains additional search options that you can add to an application to retrieve the best possible result set.

If the search does not yield results on the default server, then the server can return a referral for another server for the client to search. If referral chasing is set to All, then the client will query the server named in the referral. If set to None, then the client will not chase referrals. To set referral chasing, use the ReferralChasing property. The flags that can be used for ReferralChasing can be found in the ReferralChasingOption enumeration. The following code examples show how to set this property.

DirectoryEntry entry = new DirectoryEntry("LDAP://CN=computers,DC=buffalo,DC=corp,DC=fabrikam,DC=com");
DirectorySearcher mySearcher = new DirectorySearcher(entry);
mySearcher.ReferralChasing = ReferralChasingOption.All;
// Handle results.
// Handle errors.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ