Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DataRower
Regular Visitor

Using Powershell and ReportService2010.asmx to get datasource details how to find ds path

I am using powershell and the ReportService2010.asmx endpoint to retrieve list of SSRS Reports and their dataSources from PBI Reportserver.  For background, I am calling these functions created by  written by Jana Sattainathan. ( I am rather new to powershell)
I am able to pull reports, and for each report I can get a datasource REFerence.  Bu now I am trying to call GetDataSourceContents so I can get the connectionString and other details.  From the datasource object I have access to datasource reference and name,  report path and name , But I think I need the path to the datasource itself. (Code below )
Can anyone help me figure out how to construct this value?  OR,  The GetDataSourceContents I am callin may not be the correct one?  It does not show up in my "commands" window in the ISE , but it pops up when putting a . after the $reportproxy I am using which is https://MyServer.com/ReportServer/ReportService2010.asmx

$Reports = Get-SSRSReport -ReportServerUri $PBIRSReportServerUri -ReportFolderPath $StartFolder

foreach ($Report in $Reports){
    Write-Host $Report.Name $Report.Path $Report.TypeName 

    $DSS = Get-SSRSReportDataSource  -ReportServerUri $PBIRSReportServerUri -ReportFolderPath "/AP Administrators"  

    foreach ($DS in $DSS){
        Write-Host   $DS.ReportName $DS.ReportPath $DS.DataSourceName $DS.ReportPath  $DS.ReportName
        $validObject = $reportproxy.GetDataSourceContents($DS.ReportPath) <---What should this value be?
        Write-Host $validObject.ConnectString  -ForegroundColor Cyan
    } 
}

Error Message: Exception calling "GetDataSourceContents" with "1" argument(s): "The operation you are attempting on item '/AP Administrators/Server Administration/SQL Datafeed History' is not allowed for this item type
Here is a sample url to a datasource on the server , but I don't think it helps
https://MyServer/Reports/manage/catalogitem/datasources/folder/subfolder/reportname?_pk=sdp2ph00


1 REPLY 1
Anonymous
Not applicable

Hi @DataRower ,

Please refer below url, hope it is helpful for you.

powershell - Return all SSRS reports in a folder with the data source name and ConnectString - Stack...

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.