Querying LDAP with multiple domains

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

Comments (2) -

JC Penney EDI
JC Penney EDI
4/8/2009 1:53:04 PM #

I wish I could help you with your problem. I am new to hosting on IIS6 and using asp.net, but I like these type of engaging communications.

alski
alski
4/8/2009 3:26:11 PM #

Maybe I should have been clearer. The answer was to not use the default domain, but instead supply a DirectoryEntry as above.

Good luck as you get to grips with IIS and ASP.net.

Add comment

  Country flag


  • Comment
  • Preview
Loading