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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Reporting Services PowerShell: Setting DataSource of a PowerbiReport

Hello,

 

I am trying to set the User and the Password of a Powerbi Dashboard via the PowerShell Reporting Services:

https://github.com/microsoft/ReportingServicesTools

 

cred.PNG

 

If I am trying to get the DataSource of a PBIX Report, the count is 0.

 

$ds = Get-RsItemDataSource -proxy $Proxy -RsItem $dataSourcePath
$ds.Count

 

or  (from https://github.com/microsoft/ReportingServicesTools/blob/master/Tests/CatalogItems/Set-RsItemDataSou...)

 

$ds = Get-RsItemDataSource -Path $dataSourcePath -Proxy $proxy
$ds.Count

 

If I Change the ReportPath to something that does not exist, the whole script fails, so the Path should be correct.

 

What am I doing wrong?

 

Thanks and Best Regards

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI,

 

i got a solution now. You need to access the Portal instead of the server:

$ReportServerUri = "http://<<ServerName>>/PBIReportServer"
$ReportPortalUri = "http://<<ServerName>>/PBIReports"
Get-RsRestItemDataSource -RsItem $dataSourcePath -ReportPortalUri $ReportPortalUri

 no I can access via:

 

foreach ($dataSource in $ds) {
$dataSource.DataModelDataSource.Username = "TestAPI"
}

 

 

and set it via:

Set-RsRestItemDataSource -RsItem $dataSourcePath -DataSource $ds -RsItemType PowerBIReport -ReportPortalUri $ReportPortalUri

 

Hope this helps someone else.

 

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI,

 

i got a solution now. You need to access the Portal instead of the server:

$ReportServerUri = "http://<<ServerName>>/PBIReportServer"
$ReportPortalUri = "http://<<ServerName>>/PBIReports"
Get-RsRestItemDataSource -RsItem $dataSourcePath -ReportPortalUri $ReportPortalUri

 no I can access via:

 

foreach ($dataSource in $ds) {
$dataSource.DataModelDataSource.Username = "TestAPI"
}

 

 

and set it via:

Set-RsRestItemDataSource -RsItem $dataSourcePath -DataSource $ds -RsItemType PowerBIReport -ReportPortalUri $ReportPortalUri

 

Hope this helps someone else.

 

Best Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.