troubleshooting Question

How to query a secondary domain controller using LDAP?

Avatar of awp5379
awp5379 asked on
Windows NetworkingActive Directory
4 Comments1 Solution1890 ViewsLast Modified:
I'm working on a project where I am programmatically checking all the users for a given domain (and there are several domains). For example, I'll use a LDAP query like this:
"LDAP://DC=CA,DC=microsoft,DC=com" with a .Filter = ("(objectClass=user)"). Everything is fine.

CA is mapped to go to CA-server1. All users are returned poperly.

Apparently at 2 remote locations, the primary domain controller does not have the pwdLastSet and useraccountcontrol fields setup properly on CA-server1 (for whatever reason, outside of my control). At each location, there is a secondary domain controller (which I'll reference as CA-server2)., which does have the correct values for each user; but I am unable to figure out how to query the second domain controller successfully for users. for example:
"LDAP://CN=CA-server2,OU=Domain Controllers,DC=CA,DC=microsoft,DC=com" this query will run, but does not return users.

Is there a way to still query DC=CA, but pull the users from a different server rather than the default server
Jeremy WeisingerSenior Network Consultant / Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros