How to Determine which DC answers LDAP Query

  • Thread starter Robert Bryan via .NET 247
  • Start date
R

Robert Bryan via .NET 247

Hello,
Is there any way to determine which server answers an LDAP query? One that is not directed at a particular server that is.

ie.

DirectoryEntry oUser=new DirectoryEntry("LDAP://Domain/DC=Domain,DC=COM","","",AuthenticationTypes.Secure);

Thanks,
Bob
 
A

Arild Bakken

Hi,

I'm not sure there is. If you need to know the server you're connected to,
you might want to do it the way I do:

connect to LDAP://DOMAIN/rootDSE (or LDAP://rootDSE if the computer is in
the domain you're contacting) and read the dnsHostName property. That will
give you the name of the server that answered the request, then use that
servername for the other requests. The rootDSE is also the object that will
give you the namingContexts that are available.


Arild

Robert Bryan via .NET 247 said:
Hello,
Is there any way to determine which server answers an LDAP query? One
that is not directed at a particular server that is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top