Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Dear all,
Currently we're running Report Server on our local server, while we need to change the data source connection strings from testing data to product data.
After some research, we find a possible solution: Change data source connection strings with PowerShell - Power BI | Microsoft Learn
While we can only succesfully run the powershell command on the Report Server environment, is it possible to use the same powershell command on another IP address(eg., company's personal desktop)?
Any advice or suggestions would be great.
Thanks!
Best Regards,
Alex
Solved! Go to Solution.
Hi, @alexyin1053
You can run PowerShell commands on different IP addresses, such as your company's personal desktop, to change the data source connection string. However, you need to pay attention to the firewall and network configuration.
Make sure the necessary ports are open on the firewall (default is 5985 for HTTP and 5986 for HTTPS) to allow remote PowerShell connections. Also verify that your network policy allows remote connections to the report server.
Also make sure that the user account you're using has the necessary permissions to execute PowerShell scripts on the report server.
Make sure PowerShell Remoting is enabled on the report server. You can enable it on the server with the following command:
Enable-PSRemoting -Force
On your personal desktop, you can use the Invoke-Command cmdlet to run PowerShell scripts on a remote server
$session = New-PSSession -ComputerName "ReportServerIP" -Credential (Get-Credential)
Invoke-Command -Session $session -ScriptBlock {
# Your PowerShell script to change the connection string
}
Remove-PSSession -Session $session
A PowerShell script that changes the connection string of a data source might look like this
$dataSource = Get-RsDataSource -ReportServerUri "http://ReportServerIP/ReportServer" -Path "/path/to/report"
$dataSource.ConnectionString = "data source=ProductDataServer;initial catalog=ProductDatabase;persist security info=False"
Set-RsDataSource -ReportServerUri "http://ReportServerIP/ReportServer" -Path "/path/to/report" -DataSource $dataSource
You can refer to it.
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @alexyin1053
You can run PowerShell commands on different IP addresses, such as your company's personal desktop, to change the data source connection string. However, you need to pay attention to the firewall and network configuration.
Make sure the necessary ports are open on the firewall (default is 5985 for HTTP and 5986 for HTTPS) to allow remote PowerShell connections. Also verify that your network policy allows remote connections to the report server.
Also make sure that the user account you're using has the necessary permissions to execute PowerShell scripts on the report server.
Make sure PowerShell Remoting is enabled on the report server. You can enable it on the server with the following command:
Enable-PSRemoting -Force
On your personal desktop, you can use the Invoke-Command cmdlet to run PowerShell scripts on a remote server
$session = New-PSSession -ComputerName "ReportServerIP" -Credential (Get-Credential)
Invoke-Command -Session $session -ScriptBlock {
# Your PowerShell script to change the connection string
}
Remove-PSSession -Session $session
A PowerShell script that changes the connection string of a data source might look like this
$dataSource = Get-RsDataSource -ReportServerUri "http://ReportServerIP/ReportServer" -Path "/path/to/report"
$dataSource.ConnectionString = "data source=ProductDataServer;initial catalog=ProductDatabase;persist security info=False"
Set-RsDataSource -ReportServerUri "http://ReportServerIP/ReportServer" -Path "/path/to/report" -DataSource $dataSource
You can refer to it.
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
4 | |
4 | |
3 | |
2 | |
2 |