I've read tons of questions and answers (from Pinal Dave's website, Microsoft links and everything) about my error but none of them helped me. I've found questions and answers from nine years ago to today.
I created a Linked Server with proper username/password to read info from our Active Directory (AD).
But it doesn't matter what user I use (we tried everything, even with the most powerful 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 security tab to run with the specific user that can read the AD.
These are the queries I'm trying:
SELECT top 100 * FROM OpenQuery (
ADSI, 'SELECT displayname FROM
''LDAP://myDomain.local/OU=Usuarios'''
)
SELECT TOP 100 * FROM OPENQUERY
(ADSI,'SELECT displayname FROM
''LDAP://myDomain.local/OU=USUARIOS,DC=MyDomain,DC=LOCAL'''
)
SELECT * FROM OpenQuery (
ADSI,
'SELECT *
FROM ''LDAP://myDomain.local/DC=MyDomain,DC=local''
WHERE objectClass = ''User''
')
I opened management studio with this powerful user and it still doesn't work. What can be the error here?
I'm querying the AD server remotely from my machine from SSMS.
Asked by Racer SQL
(7546 rep)
Jan 18, 2021, 12:16 PM
Last activity: Jul 27, 2025, 05:04 PM
Last activity: Jul 27, 2025, 05:04 PM