Forum Discussion
Anonymous
7 years agoNot applicable
Issues with Powershell script and stored credentials when deploying on-Prem
We're using the Powershell script concept from here, to push Power BI reports up to our on-prem Power BI report server. https://github.com/microsoft/ReportingServicesTools Have some across somet...
d_gosbell
Super User
7 years agoLooking at the examples when you do a:
Get-Help Set-RsRestItemDataSource -Full
it appears that the DataSources parameter might be expecting an array of data source objects. Have you tried the following sort of pattern to reset the username/password?
$dataSources = Get-RsRestItemDataSource -RsItem '/MyPowerBIReport'
$dataSources[0].DataModelDataSource.AuthType = 'UsernamePassword'
$dataSources[0].DataModelDataSource.Username = 'sqlSa'
$dataSources[0].DataModelDataSource.Secret = 'sqlSaPassword'
Set-RsRestItemDataSource -RsItem '/MyPowerBIReport' -RsItemType PowerBIReport -DataSources $datasources
I don't think there is a valid way of directly injecting a value into the tables. Directly modification of the tables is not supported and you would need access to the server encryption key to generate the correct value anyway.