<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Powershell script to change Datasource Test to Production in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/580705#M8917</link>
    <description>&lt;P&gt;this one is for&amp;nbsp;updating a connectionstring to a SSAS database using stored credentials.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 17:18:30 GMT</pubDate>
    <dc:creator>fbeekvel</dc:creator>
    <dc:date>2018-12-06T17:18:30Z</dc:date>
    <item>
      <title>Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/576347#M8890</link>
      <description>&lt;DIV class="_1rcejqgj_laTEewtp2DbWG s1pjq3q3-0 jnulSo"&gt;&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;&lt;/DIV&gt;&lt;DIV class="s1pjq3q3-5 hnoUuE s1hmcfrd-0 ckueCN"&gt;&lt;P class="yklcuq-10 hpxQMr"&gt;Does someone have a powershell script to change the data source?&lt;BR /&gt;For example I want deploy my report to powerBI reporting service from Test to Productios therefore i need to change the datasource from&lt;BR /&gt;OTA-DWH-01\Test to OTA-DWH-02\Production&lt;BR /&gt;I have a lot of reports so doing it manually will take a lot of time. I now have to open each report indivually and change the datasource.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Nov 2018 13:00:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/576347#M8890</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-30T13:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/576611#M8892</link>
      <description>&lt;P&gt;I don't know if there is an existing script for this however it should be pretty straightforward assuming your using Shared DataSources. All you would need to do is issue a PUT request to the following REST API for each of your reports:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;http://&amp;lt;server&amp;gt;/reports/api/v2.0/Reports(ID/Path)/DataSources&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As for the payload you just need to update the path to the new DataSource. You can refer to the API docs here:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/Reports/SetReportDataSource" href="https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/Reports/SetReportDataSource" target="_self"&gt;https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/Reports/SetReportDataSource&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 22:43:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/576611#M8892</guid>
      <dc:creator>mgmeyer</dc:creator>
      <dc:date>2018-11-30T22:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/576650#M8893</link>
      <description>&lt;P&gt;Here are some links:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://byobi.com/2018/04/programmatically-deploy-power-bi-reports-to-power-bi-report-server/" target="_blank"&gt;http://byobi.com/2018/04/programmatically-deploy-power-bi-reports-to-power-bi-report-server/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://sqldbawithabeard.com/2018/08/21/deploying-to-a-power-bi-report-server-with-powershell/" target="_blank"&gt;https://sqldbawithabeard.com/2018/08/21/deploying-to-a-power-bi-report-server-with-powershell/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.blue-granite.com/blog/power-bi-report-server-devops" target="_blank"&gt;https://www.blue-granite.com/blog/power-bi-report-server-devops&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 09:22:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/576650#M8893</guid>
      <dc:creator>fbeekvel</dc:creator>
      <dc:date>2018-12-01T09:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/577371#M8897</link>
      <description>There is a Powershell script for this under the Azure-Samples repo. Just remember that you need to register an App to get a Client ID to use with it. &lt;A href="https://github.com/Azure-Samples/powerbi-powershell/blob/master/rebindReport.ps1" target="_blank"&gt;https://github.com/Azure-Samples/powerbi-powershell/blob/master/rebindReport.ps1&lt;/A&gt;</description>
      <pubDate>Mon, 03 Dec 2018 12:08:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/577371#M8897</guid>
      <dc:creator>CasperLehmann</dc:creator>
      <dc:date>2018-12-03T12:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/577531#M8898</link>
      <description>&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Does this also work for power bi report server? because when i look into the script it says i need to get the source report info from powerbi service.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:27:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/577531#M8898</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-03T15:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/578275#M8906</link>
      <description>I don't know how you connect to the report server, there might be differences. But please report back if you do try it out. I would like to know.</description>
      <pubDate>Tue, 04 Dec 2018 09:58:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/578275#M8906</guid>
      <dc:creator>CasperLehmann</dc:creator>
      <dc:date>2018-12-04T09:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/579867#M8913</link>
      <description>&lt;P&gt;(Responding to&amp;nbsp;fbeekvel)&lt;/P&gt;&lt;P&gt;Everything I've tried to change the ReportServer connection string, including all 3 articles you've attached. The connection string is local to the file, and the file only. The connection string is read-only in the ReportServer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd love to be proven wrong, but I don't think it's possible. One possible way is to zip the file and change the connection string text, then zip it back up. That's not enterprise-grade though so I haven't pursued it.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:55:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/579867#M8913</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-05T22:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/579870#M8914</link>
      <description>I'm pretty sure It works. I have a working script somewhere, I'll see if I can post it tomorrow.</description>
      <pubDate>Wed, 05 Dec 2018 22:57:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/579870#M8914</guid>
      <dc:creator>fbeekvel</dc:creator>
      <dc:date>2018-12-05T22:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/580704#M8916</link>
      <description>&lt;P&gt;#Install-Module -Name ReportingServicesTools&lt;/P&gt;&lt;P&gt;&amp;lt;# Set parameters #&amp;gt;&lt;BR /&gt;$ReportServerURI = 'https://MyReportServer/reports'&lt;BR /&gt;$MyReport = "/Folder/Reportname"&lt;BR /&gt;$MyUserName = "domain\account"&lt;BR /&gt;$MyPassword = "password"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try {&lt;BR /&gt;Write-Verbose "Creating a session to the Report Server $ReportServerURI"&lt;BR /&gt;# establish session w/ Report Server&lt;BR /&gt;$session = New-RsRestSession -ReportPortalUri $ReportServerURI&lt;BR /&gt;Write-Verbose "Created a session to the Report Server $ReportServerURI"&lt;BR /&gt;}&lt;BR /&gt;catch {&lt;BR /&gt;Write-Warning "Failed to create a session to the report server $ReportServerURI"&lt;BR /&gt;Return&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;try {&lt;BR /&gt;Write-Verbose "Getting the datasources from the pbix file for updating"&lt;BR /&gt;# get data source object&lt;BR /&gt;$datasources = Get-RsRestItemDataSource -WebSession $session -RsItem "$MyReport"&lt;BR /&gt;Write-Verbose "Got the datasources for updating"&lt;BR /&gt;}&lt;BR /&gt;catch {&lt;BR /&gt;Write-Warning "Failed to get the datasources"&lt;BR /&gt;Return&lt;BR /&gt;}&lt;BR /&gt;try {&lt;BR /&gt;Write-Verbose "Updating Datasource"&lt;BR /&gt;&lt;BR /&gt;foreach ($dataSource in $datasources) {&lt;BR /&gt;&lt;BR /&gt;$dataSource.CredentialRetrieval = 'Store'&lt;BR /&gt;$dataSource.ConnectionString = "Data Source=SSASserver;Initial Catalog=SSASdatabase"&lt;BR /&gt;$dataSource.IsConnectionStringOverridden = $True&lt;BR /&gt;$dataSource.DataModelDataSource.Username = $MyUserName&lt;BR /&gt;$dataSource.DataModelDataSource.Secret = $MyPassword&lt;BR /&gt;}&lt;BR /&gt;Write-Verbose "Updating the data source for the report $PBIXName"&lt;BR /&gt;# update data source object on server&lt;BR /&gt;Set-RsRestItemDataSource -WebSession $session -RsItem "$MyReport" -RsItemType PowerBIReport -DataSources $datasource&lt;BR /&gt;}&lt;BR /&gt;catch {&lt;BR /&gt;Write-Warning "Failed to set the datasource"&lt;BR /&gt;Return&lt;BR /&gt;}&lt;BR /&gt;Write-Verbose "Completed Successfully"&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 17:16:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/580704#M8916</guid>
      <dc:creator>fbeekvel</dc:creator>
      <dc:date>2018-12-06T17:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/580705#M8917</link>
      <description>&lt;P&gt;this one is for&amp;nbsp;updating a connectionstring to a SSAS database using stored credentials.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 17:18:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/580705#M8917</guid>
      <dc:creator>fbeekvel</dc:creator>
      <dc:date>2018-12-06T17:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/580735#M8918</link>
      <description>&lt;P&gt;This maybe be a stupid question (powershell noob) but how do i do this for example if i have a folder named 'mypowerbifolder' where i have 20 pbix files in&amp;nbsp;C:\Users\Tanako123\Documents\mypowerbifolder and want to run this script for all my pbix files in this folder.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I tried to google this how to do this, which should be pretty easy i think but i couldnt understand the logic&lt;BR /&gt;&lt;BR /&gt;it should be a combination of get-childitem and for each?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 17:54:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/580735#M8918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-06T17:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/622063#M9575</link>
      <description>&lt;P&gt;I've tried the powershell script mentioned in this thread but I will always get a 400 bad request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried using the API (&lt;A href="https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/UpdatePowerBIReportDataSource" target="_blank"&gt;https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/UpdatePowerBIReportDataSource&lt;/A&gt;) and will also get 400 bad request if I touch the connection string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has any other ideas, I'm open to trying as in my organization we have multiple environments I would like to deploy to automatically.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 22:55:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/622063#M9575</guid>
      <dc:creator>cchen407etr</dc:creator>
      <dc:date>2019-02-12T22:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/737262#M10931</link>
      <description>&lt;P&gt;Is there any solution to this problem? We are trying to edit a PBIRS DataSource connecting to an on-premise SQL Server database, using the UpdatePowerBIReportDataSource method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No matter what we edit (database name, server or user), we get a 400 bad request...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our PBIRS is 15.0.1102.371 (Mai 2019).&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 07:11:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/737262#M10931</guid>
      <dc:creator>imichalarias</dc:creator>
      <dc:date>2019-07-11T07:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/737627#M10939</link>
      <description>&lt;P&gt;To my knowledge, it is only possible with SSAS-based sources. It's certainly not possible with SQL Server databases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're able to attempt this with your report by: "Manage"--&amp;gt;"Data sources"--&amp;gt;"Connection string". Try to edit the connection string. It's possible in SSAS but nothing else I've ran into.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 13:30:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/737627#M10939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-11T13:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script to change Datasource Test to Production</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/738686#M10956</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;thanx for the quick reply! I have no clue (and no understanding) why this function is limited to SSASconnections only... What were they thinking??? Let's hope it is going to be fixed soon...&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 10:56:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Powershell-script-to-change-Datasource-Test-to-Production/m-p/738686#M10956</guid>
      <dc:creator>imichalarias</dc:creator>
      <dc:date>2019-07-12T10:56:09Z</dc:date>
    </item>
  </channel>
</rss>

