Hello I am trying to run a query via tsql against ad. Below is the error I am getting. I have read the http://msdn2.microsoft.com/en-US/library/ms190803.aspx and changed the domain but still having issues. Any help would be appreciated.
EXEC
sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces','ADSDSOObject'
, 'adsdatasource'GO
SELECT
*FROM
OPENQUERY( ADSI, 'SELECT Name, SN, STFROM ''LDAP://ADSISrv/ OU=Users,DC=XXXXX,DC=LOCAL''
WHERE objectCategory = ''Person'' AND
objectClass = ''user'''
)Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT Name, SN, ST
FROM 'LDAP://ADSISrv/ OU=Users,DC=XXXXX,DC=LOCAL'
WHERE objectCategory = 'Person' AND
objectClass = 'user'" for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".

SQL 2005 LDAP Query Error: Msg 7321, Level 16
marrigre
The domain name is required in the Security settings for the remote login - I should have known that. So in the Security settings I selected Be made using this security context, entered Remote login: domain\user; With password: password.
SkiesOfBordom
I got it to work on the local database server. It didn't seem to like the OU. Once I removed it the query completed. However I still get the message if I try and run the view from a remote computer using Mgmt Studio is there something I have to setup on the clients
SELECT * FROM vcnet.dbo.viewADContacts--gives errors from workstations but not if run from the server itself
Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT sAMAccountname,givenname,sn,displayname,useraccountcontrol,CN, manager, mobile , mail, objectCategory,
department,
telephoneNumber,
facsimileTelephoneNumber
FROM 'LDAP://DC=XXXXX,DC=local'
WHERE objectCategory='person' AND objectClass='user'" for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".
jermaine88
JFoushee
thedewd