Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
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
$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
Solved! Go to Solution.
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
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!