I’m trying to use the OLEDB provider to link AD to SQL server to run some add hoc queries. It’s returning an error:

Server: Msg 7321, Level 16, State 2, Procedure vw_AD_USER_INFO, Line 4

An error occurred while preparing a query for execution against OLE DB provider 'ADSDSOObject'.

OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandPrepare::Prepare returned 0x80040e14].

 

There are numerous articles on this error, but they all seem to indicate syntax, but I’m using the exact same syntax as the query they say works (as far as I can tell).

 

After executing my sp_addlinkedserver statement, which works fine, I run the following:

 

SELECT * FROM OpenQuery(ADSI, 'SELECT sAMAccountName, givenName, sn, physicalDeliveryOfficeName FROM ''LDAP://cn=users,dc=iput,dc=myrealdomain,dc=here'' where objectClass = ''User''')

 

That’s when I get the above error. Just thought I’d check to see if anyone else has had success with this. Thanks!

 

Mark Creamer

Systems Engineer

Cintas Corporation

 

Reply via email to