# Sql-server – Querying AD from SQL Server

active-directorysql-server-2012

I've read tons of questions and answers about my error but none of them helped me ( from PINAL website, microsoft links and everything ). questions from 9 years ago to today.

but it doesn't matter what user I use ( we tried everything, even with the most powerfull user we have in the network that can make it rain if it wants ) and I still get the same error:

Msg 7399, Level 16, State 1, Line 16
The OLE DB provider "ADsDSOObject" for linked server "ADSI" reported an error. The provider indicates that the user did not have the permission to perform the operation.


i tried to run SSMS with the user with no success. I set the secutiry tab to run with the specific user that can read the AD.

these are the queries i'm trying :
SELECT top 100 * FROM OpenQuery (
''LDAP://myDomain.local/OU=Usuarios'''
)

SELECT TOP 100 * FROM OPENQUERY
''LDAP://myDomain.local/OU=USUARIOS,DC=MyDomain,DC=LOCAL'''
)

SELECT * FROM OpenQuery (