I want to run this query:
SELECT top 10 *
FROM openquery(ADSI, '
select *
from ''LDAP://londcrwc02.adslocal.net:389/ dc=adslocal,dc=net''
where objectCategory = ''Person''
and objectClass = ''user''
')
In two different servers, the first server can run the query perfect but the second one has this error:
Msg 7321, Level 16, State 2, Line 163
An error occurred while preparing the query "
select *
from 'LDAP://londcrwc02.adslocal.net:389/ dc=adslocal,dc=net'
where objectCategory = 'Person'
" for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI".