I'm trying to query an ActiveDirectory but at my current client site, I have a problem. There's a few. The client has previously migrated their DC from XPERT to EUROPE, and now they've bought a division of another company and added that in as well. As a result the default DC only supplies half of the staffs email addresses.
Fortunately you can override the default DC by the use of,
DirectoryEntry root = new DirectoryEntry("LDAP://DC=SUBDOMAIN,DC=DOMAIN,DC=com");
Just update DOMAIN and SUBDOMAIN to where you are. More details on http://msdn.microsoft.com/en-us/library/system.directoryservices.directorysearcher.searchroot.aspx