Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello everybody,
we use PowerShell to upload and overwrite Power BI Reports on the Report Server.
This is the command, which we use for both tasks:
Write-RsRestCatalogItem -WebSession $session -Path $PowerBIReportFilePath -RsFolder $RsFolderName -Overwrite $true
However, it happens that the credentials-settings of an uploaded Report is either
or
We wish that for each uploaded or overwritten Report the "Authentication Type" setting is "Windows Authentication" and that the point "As the user viewing the report" is always checked. This is our main objective.
To achieve our goal, I added the following lines, after the uploading command (Write-RsRestCatalogItem) from above:
# the value of $PowerBIReportFileNamePathOnRs is something like /Folder/ReportName - without the extension '.pbix'
$dataSource = Get-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs
$dataSource.DataModelDataSource.AuthType = "Windows"
$dataSource.CredentialRetrieval = "Integrated"
Set-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs -RsItemType PowerBIReport -DataSources $dataSource
Unfortunately, with these commands, we always end up with these settings:
What are the correct commands to set the wished settings with PowerShell?
With best regards
Solved! Go to Solution.
According to the official documentation by Microsoft, this is the correct way of doing it:
# the value of $PowerBIReportFileNamePathOnRs is something like /Folder/ReportName - without the extension '.pbix'
$dataSource = Get-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs
$dataSource.DataModelDataSource.AuthType = 'Integrated'
Set-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs -RsItemType 'PowerBIReport' -DataSources $dataSource
And it is working fine!
That is awesome you did, if you can mark your reply as solution, so others can find your method quickly when researching.
Paul Zheng _ Community Support Team
According to the official documentation by Microsoft, this is the correct way of doing it:
# the value of $PowerBIReportFileNamePathOnRs is something like /Folder/ReportName - without the extension '.pbix'
$dataSource = Get-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs
$dataSource.DataModelDataSource.AuthType = 'Integrated'
Set-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs -RsItemType 'PowerBIReport' -DataSources $dataSource
And it is working fine!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |