1 year ago

#188389

test-img

Wojciech

SQL Server Reporting Services cannot access Active Directory

I have a stored procedure that uses OPENQUERY with ADSI to access Active Directory like this.

SELECT ADsPath, displayName, sAMAccountName, mail, userPrincipalName, manager
FROM OPENQUERY(ADSI, '<LDAP://...>;(&(objectCategory=user)(objectClass=user));manager,userPrincipalName,mail,sAMAccountName,displayName,ADsPath;subtree')

It executes successfully in SSMS but when I use it as a data source in an SSRS report, I get this.

An error has occurred during report processing. (rsProcessingAborted) Query execution failed for dataset 'DSMAIN'. (rsErrorExecutingCommand) An error occurred while preparing the query "LDAP://...;(&(objectCategory=user)(objectClass=user));manager,userPrincipalName,mail,sAMAccountName,displayName,ADsPath;subtree" for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".

When I go back to the stored procedure and comment out the OPENQUERY part, the report will run successfully and remaining data will be displayed as normal. When I include the OPENQUERY again, it will stop working again.

Why does it run from SSMS but not from SSRS? It might be an issue with permissions, however the user account used by report server appears to be able to access Active Directory elsewhere (e.g. ADUC).

sql-server

reporting-services

active-directory

openquery

adsi

0 Answers

Your Answer

Accepted video resources