Groups | Blog | Home
all groups > sql server misc > november 2006 >

sql server misc : querying AD across domains


jay.meerdink NO[at]SPAM gmail.com
11/7/2006 6:53:32 AM
Greetings -

I'm trying to query AD across domains.
If I have a QA open in my internal domain, and my external domain is
"myextdomain".

SELECT *
FROM OPENROWSET(
'AdsDsoObject','User ID=extdomain\Admin;Password=pwd',
'SELECT name FROM
''LDAP://myextdomainctrlr.com:445/OU=WASP,OU=Logins,OU=External,DC=mydomain,DC=com''

WHERE objectClass = ''organizationalUnit''
'
)

I get the error

Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query...

Does the query run in the SQLServer context even though I submit domain
creds? Is there a different way to establish the security context for
the query? BTW, I've tried ports 445 and 389, not sure which one is
right.


Thanks for your help,
Jay
Frank
11/17/2006 3:20:36 PM
I'm not the AD expert by any means, and have never tried this but maybe try
it using the Global Catalog port on your DC ?

I believe it's port # 1026 ?

Hope this helps.

Frank

[quoted text, click to view]

AddThis Social Bookmark Button