Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a program that gets login information from Active Directory, I use an LDAP URL simular to this (to query


Is there a way to query and (not in the same forest) using the same URL? Or do I have to rewrite the program to query them serially? (I am trying to avoid a rewrite.)

EDIT: As I suspected, I would have to query them seperately. Outside of the evil EE, I didn't find anything to confirm this. Thanks everyone.

share|improve this question
up vote 2 down vote accepted

No, you can't interrogate two different domains in the same LDAP query. You need to work around this programatically

share|improve this answer

EDIT: Misread question. I believe you'll have to query them sequentially.

share|improve this answer

You'll have to do them separately.

share|improve this answer

Assuming your domains are in the same AD forest, you'll want to query the global catalog to do a cross-domain query. Changing the query URI to GC:// instead of LDAP:// indicates you want to specifically do a global catalog query. LDAP will go straight to a domain controller of the specific domain which won't necessarily know anything about the other domains you are interested in.


Keep in mind, though, that the global catalog only has a subset of the attributes available in the AD schema so you might have to go out to the domains themselves anyway. Here's a list of AD global attributes.

Note that it doesn't look like the domains in your question would be in the same forest.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.