AD Linked Server

I have been trying to configure a linked server to AD and have found plenty of write ups on how to do it, but have had zero luck with getting it to work.  I also read that the ability was removed after SQL 2008; is that correct?  I am running 2014 and am seeing the following error trying to expand the tree:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Cannot obtain the required interface ("IID_IDBSchemaRowset") from OLE DB provider "ADSDSOObject" for linked server "ADSI". (Microsoft SQL Server, Error: 7301)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.4100&EvtSrc=MSSQLServer&EvtID=7301&LinkId=20476


Then the following error when trying to query:

SELECT * FROM OpenQuery(ADSI, 'SELECT displayName FROM ''LDAP://<DOMAIN>/DC=DOMAIN,DC=<DOMAIN>'' WHERE objectCategory=''User'' ')

Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT displayName FROM 'LDAP://----/DC=----,DC=----' WHERE objectCategory='User' " for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI". 

The linked server is set for 'Be made by the login's current security context' and local to remote is configured SA to a domain account we use for lookups.  

It does not seem to matter if I am logged in to the server with SQL or Windows credentials.  Thank you in advance for any gui

August 21st, 2015 7:51pm

irst execute your query:

EXEC sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces',

'ADSDSOObject'

, 'adsdatasource'

GO

Like daw21 explain before follow the detail steps:

Second step go to the SqlServer management Studio and edit manually the Linkserver name ADSI:

go to Server Objects/Linked Servers/  and right click on ADSI  select the option Properties and then go to Security.

Select the option :         Be made using this security context:

and there fill the user  and Password about the valid user with permission into Active Directory, not forget before the domain\user.

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 9:13pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics