Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

LDAP://OU=MYCO,DC=MYCOMPANY,DC=COM

Is there a way to query mycompany.com and yourcompany.com (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
add comment

4 Answers

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
add comment

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

share|improve this answer
add comment

You'll have to do them separately.

share|improve this answer
add comment

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.

GC://dc=domain,dc=com/....

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
add comment

Your Answer

 
discard

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.