How to Determine which DC answers LDAP Query

  • Thread starter Thread starter Robert Bryan via .NET 247
  • Start date 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
 
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.
 
Back
Top