I have combed the forums for an answer to this but cannot find one. I have written an OPENQUERY statement which works perfectly on my local SQL Server installation on my computer. First I create the linked server:EXEC master.dbo.sp_addlinkedserver @server = N'ADSI', @srvproduct=N'Active Directory Services 2.5', @provider=N'ADsDSOObject', @datasrc=N'adsdatasource', @provstr=N'ASDSOObject'Then I use my admin account (ADSI security is to use the logins security context) to run this query (changed the OU and DC names for this post):SELECT * FROM OPENQUERY (ADSI, 'SELECT ADsPath FROM ''LDAP://OU=ClientGroup,DC=accounts,DC=top,DC=second,DC=third'' WHERE cn = ''*Workstation-Client*'' ')15 rows are returned. Cool.Then I add a linked server using same SP above on our development server using the same admin account, and test the connection. All OK still.Then I run the exact same query on the development server with no changes and get the error: "Cannot execute the query "<entire SELECT query is here>" against the OLE DB provider "ADsDSOObject" for linked server "ADSI".I change the ADSI security context to the fourth option to specify my admin account and password (in case there was a Kerberos double hop issue) and get this error: "Cannot fetch a row from OLE DB provider "ADsDSOObject" for linked server "ADSI"."Notes: The servers are locked down so that OPENROWSET is not allowed, only OPENQUERY is allowed, so I cannot do any OPENROWSET operations. Only 15 rows are returned so I am not running into the 1000 row limit. Since I am able to access the domain and successfully return records from my PC on the domain, I figure the only thing could be some sort of policy or limitation on the Servers themselves. I do not have sysadmin on the SQL Servers in which the query fails, but do on my local PC in which the query succeeds. However, another member of my team DOES have sysadmin and runs into the same errors as me.Any ideas?
↧