Querying LDAP with multiple domains

by alski 31. March 2009 16:48

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

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Code

Comments

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

RecentComments

Comment RSS