By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,781 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,781 IT Pros & Developers. It's quick & easy.

How to Determine which DC answers LDAP Query

P: n/a
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

--------------------------------
From: Robert Bryan

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>gtoK6tnZIEaH0AcxF53xkw==</Id>
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <an*******@dotnet247.com> wrote in message
news:ev**************@tk2msftngp13.phx.gbl...
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.Se
cure);
Thanks,
Bob

--------------------------------
From: Robert Bryan

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>gtoK6tnZIEaH0AcxF53xkw==</Id>

Nov 16 '05 #2

P: n/a
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" <an*******@dotnet247.com> wrote in message
news:ev**************@tk2msftngp13.phx.gbl...
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.Se
cure);
Thanks,
Bob

--------------------------------
From: Robert Bryan

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>gtoK6tnZIEaH0AcxF53xkw==</Id>

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.