Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6204835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:09:58+00:00 2026-05-24T05:09:58+00:00

I’m working on an application that talks to Active Directory through the LDAP provider,

  • 0

I’m working on an application that talks to Active Directory through the LDAP provider, using both C# and C++. The application runs on Windows 2003, 2008, and 2008 R2. I’m using binding strings that look like this:

LDAP://mydomain.com/CN=Fred,DC=mydomain,DC=com
LDAP://server.mydomain.com/CN=Fred,DC=mydomain,DC=com.

The application is responsible for both read and write operations in the directory. For instance, in one scenario it creates a new OU and then creates several users and groups in that new OU. In another scenario it presents a view of the directory to an interactive user and allows the user to create a new group or user account.

So far I have been using domain-based binding (the first example bind string from above), based on the advice of MSDN:

Under most circumstances, binding should not be unnecessarily tied to a single server. Active Directory Domain Services support serverless binding, which means that Active Directory can be bound to on the default domain without specifying the name of a domain controller

The problem comes in when there are multiple domain controllers on the domain; I’ll call them Lefty and Righty for now. If I bind to the directory using LDAP://mydomain.com/blah, I’m implicitly connecting to either Lefty or Righty. Here’s an example scenario of what happens:

  1. Bind to the root of mydomain.com. The Active Directory guts choose Lefty as the server to talk to.
  2. Create a new OU called Container. The OU is created on Lefty.
  3. Attempt to bind to the new OU. The Active Directory guts choose Righty as the server to talk to, so the bind fails because Righty doesn’t know about the new OU.
  4. Wait 10-15 seconds and try the bind again. The bind succeeds when talking to either server.

In step 3, the re-bind isn’t strictly required, but in some of the scenarios there are two different executables involved, so I can’t share an IADs or DirectoryEntry. Internally I think the Active Directory guts are using DsGetDcName to choose which server to talk to, and the docs for that have some discussion about how it chooses a domain controller and how it caches that info. Unfortunately it’s not something that the application can really control, as far as I can tell. In some cases I see the applications consistently connecting to one domain controller or the other, but in other cases the applications seem to switch back and forth between the domain controllers (as described above), and things don’t work.

Getting around to the actual question: is this just a fundamental limitation of domain-based binding? I think the problem would go away if I bound directly to a particular domain controller, but that complicates the application code significantly, so I was hoping to avoid it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:09:59+00:00Added an answer on May 24, 2026 at 5:09 am

    This is the inherent problem with the ldap server replications. I never used the c# api.
    I have worked on the eDirectory on linux. Right after creating an object if you are going to refer it the best option is to stick with a server/DC.

    why would it complicate the application? write a function to pick up a server. The function
    should do a dns lookup for the domain (example.com) if you have multiple domain controller it will return all the ip address, pick up the one that is functioning (ping, ldap root dse search) and return that to the caller.

    Try using the function only when you face the problem you mentioned above. In other places just stick with the domain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.