I'm using System.DirectoryServices.DirectorySearcher for traversing Active Directory for users. In most cases, this works fine. The code is pretty much as follows:
Ldapconnection conn = CreateConnection(...);
System.DirectoryServices.DirectorySearcher searcher = new System.DirectoryServices.DirectorySearcher();
searcher.SearchScope = System.DirectoryServices.SearchScope.Subtree;
foreach (System.DirectoryServices.SearchResult result in searcher.FindAll()) {
}
For some reason, this doesn't always traverse the tree completely. If I specify the searchroot to point at a missing subtree, it does import that subtree.
Am I missing something?