Hi @HSB
Not sure if these posts can help.
https://stackoverflow.com/questions/22920175/sql-linked-server-query-for-ad-returns-msg-7321
Best regards,
Percy Tang
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I get the following error: Msg 7321, Level 16, State 2, Line 14 when I run:
SELECT * FROM OPENQUERY(
ADSI,
'SELECT *
FROM ''LDAP://MYDOMAIN.org/DC=MYDOMAIN,DC=org''
WHERE objectClass = ''User''
')
I'm using my login. I am an admin and can access Active Directory, change users etc. I have set it to impersonate me and I've also tried "Be made using this security context" and supplying my credentials.
Here's a screenshot of AD and where users are located under General Users. I've tried adding OU=xx xx in the query but that doesn't change the error. Any thoughts on using SQL Server to query LDAP successfully?
Hi @HSB
Not sure if these posts can help.
https://stackoverflow.com/questions/22920175/sql-linked-server-query-for-ad-returns-msg-7321
Best regards,
Percy Tang