Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Querying Active Directories Issue

$
0
0

While I am familiar with SQL, I am having trouble retrieving data from Active Directories.  I have followed all the instructions to create a linked server, I have set the security per the documentation.  I have coded the openquery statement per the examples but I keep receiving the same error message. 

SELECT *
      FROM OPENQUERY
      (ADSI
       , 'SELECT displayName, userPrincipalName
             FROM ''LDAP://buf-dc-002/DC=mig,DC=local''
          WHERE objectClass = ''Person''')

Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT displayName, userPrincipalName
             FROM 'LDAP://buf-dc-002/DC=mig,DC=local'
          WHERE objectClass = 'Person'" for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI".

I cannot seem to find any information on why I am receiving this message.  Any assistance would be greatly appreciated. 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>