473,748 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Determine which DC answers LDAP Query

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=CO M","","",Authen ticationTypes.S ecure);

Thanks,
Bob

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

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

<Id>gtoK6tnZIEa H0AcxF53xkw==</Id>
Nov 16 '05 #1
2 8109
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*******@dotn et247.com> wrote in message
news:ev******** ******@tk2msftn gp13.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=CO M","","",Authen ticationTypes.S e
cure);
Thanks,
Bob

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

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

<Id>gtoK6tnZIEa H0AcxF53xkw==</Id>

Nov 16 '05 #2
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*******@dotn et247.com> wrote in message
news:ev******** ******@tk2msftn gp13.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=CO M","","",Authen ticationTypes.S e
cure);
Thanks,
Bob

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

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

<Id>gtoK6tnZIEa H0AcxF53xkw==</Id>

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4981
by: jeremy | last post by:
Hello. I have an asp.net application that resides on a non-DC / BDC Sharepoint Server (although it is logged into the domain). The application will perform lookups based on the current user (integrated auth) to an LDAP server which requires no login (AuthenticationTypes.None). When I run it, I get the following ambiguous error: Security Exception Description: The application attempted to perform an operation not allowed
0
321
by: Robert Bryan via .NET 247 | last post by:
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
3
2030
by: Jay | last post by:
I have a simple LDAP query (grabs all users from a particular AD group and populates a checkboxlist) that works perfectly fine on the development machine logged on locally as any user. When I access the website and run the query from a client however the query fails to run. Someone please help? Here's the code for the query (in CheckBoxListsFill sub): 'Impersonate the Windows AD user running the application Dim impersonationContext...
1
4754
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I have a page in a folder (under anonymous authentication in IIS6) that has a link on it that...
3
9878
by: Chad Beckner | last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able to query ADS to get a users groups that they belong to, and also query a group and get a list of users. However, I can't seem to get this to work in VB.Net. Here's what I have: OLD ASP Code: Function Get_ADS_Users_For_Group(ADS_Path) Dim Group_Information Dim Error_Number
5
2344
by: Bryan | last post by:
Hello, I have a asp.net app working with directory services on my Windows XP development machine. However when I moved the application over to our production server (Win 2000 Server) it no longer works. I use this code to try to connect to ldap: System.DirectoryServices.DirectoryEntry entry = new System.DirectoryServices.DirectoryEntry(LDAP://corp.mydomain.com,user,pass); I tried using my user name and password, the domain admin...
4
2036
by: h2so4 | last post by:
I want to write a program that will query an ldap directory. can I use adsi or ado to do that, If yes how ? tx -- h2so4
0
2550
by: Gerry Sinkiewicz | last post by:
Looking for a bit of software that will accept an LDAP query via port 389 and convert it to an SQL query and return the results to the originating LDAP client. Basically a dialect converter LDAP query <===> SQL query. The originating LDAP query will come from an application server. Anyone know of such a thing. I searched, but to no avail, most topics deal with how to query LDAP from
3
4038
by: RJN | last post by:
Hi I've written a code that queries Windows LDAP server and works fine, but the same doesn't work when querying Solaris LDAP server. DirectoryEntry de = new DirectoryEntry("LDAP://server.com"); DirectorySearcher ds = new DirectorySearcher(de); de.Username = "xxx"; de.Password = "yyy"; de.AuthenticationType = AuthenticationTypes.Secure;
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.