<?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: Update Shared Datasouce for Report using PowerShell in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/3459941#M31306</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82180" data-lia-user-login="Per" class="lia-mention lia-mention-user"&gt;Per&lt;/a&gt;&amp;nbsp;any chance you can post the script in text here?&amp;nbsp; The link you provided no longer works.&amp;nbsp; I'm banging my head against the wall.&lt;/P&gt;&lt;P&gt;set-rsdatasourcereference -Path &amp;lt;path to report&amp;gt; -DataSourceName &amp;lt;current report datasource&amp;gt; -DataSourcePath &amp;lt;path to replacement shared data source&amp;gt; isn't working because I can't figure out the correct syntax for providing &amp;lt;current report datasource&amp;gt;.&amp;nbsp; It's a custom data source.&amp;nbsp; I used Get-RsItemDataSource which returns a System.Object with two properties:&amp;nbsp; Name = CM&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Item = Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy13er_SCCM_ReportService2010_asmx.DataSourceDefinition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried providing CM as the &amp;lt;current report datasource&amp;gt; parameter, but no joy.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2023 16:34:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-04T16:34:49Z</dc:date>
    <item>
      <title>Update Shared Datasouce for Report using PowerShell</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/720292#M10709</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are in the process of migrating from SSRS to PBI-RS and have been testing reports in DEV using DEV Datasources.&amp;nbsp; We have over 300 reports, that we need to switch to Production Datasources, and I've been looking for a way to do it via powershell.. As a NOOB, I'm running into issues.&amp;nbsp; &amp;nbsp;I downloaded the ReportingServicesTools and it looked like it would be pretty simple... NOPE...&amp;nbsp; &amp;nbsp;I found that I should be using the Get-RSITEMDatasource and Set-RSITEMDatasource based on&amp;nbsp; my reading.. so I Ran the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;PS C:\&amp;gt; $dataSources = Get-RsItemDataSource -ReportServerUri '&lt;A href="http://powerbi.dev.sql.odnss.com/Reportserver/" target="_blank" rel="noopener"&gt;http://powerbi.dev.sql.odnss.com/Reportserver/&lt;/A&gt;' -RsItem '/docket/All Timekeepers'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Ran Succesfully&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Then I ran&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;PS C:\&amp;gt; Set-RsItemDataSource -DataSource $datasources -RsItem '/AR/AR Aging' -ReportServerUri '&lt;A href="http://powerbi.dev.sql.odnss.com/reportserver/" target="_blank" rel="noopener"&gt;http://powerbi.dev.sql.odnss.com/reportserver/&lt;/A&gt;'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;I get the error below&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Please use Set-RsDataSource to update shared data sources!&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;At C:\Program Files\WindowsPowerShell\Modules\ReportingServicesTools\0.0.5.0\Functions\CatalogItems\Set-RsItemDataSource.ps1:143 char:17&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;+ ... throw "Please use Set-RsDataSource to update shared data ...&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;+ CategoryInfo : OperationStopped: (Please use Set-...d data sources!:String) [], RuntimeException&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;+ FullyQualifiedErrorId : Please use Set-RsDataSource to update shared data sources!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;I'm not trying to update the Shared Datasource itself... I'm simply tying to update the report to use another Shared Datasouce..&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What am I doing wrong?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 14:09:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/720292#M10709</guid>
      <dc:creator>JJenkins2005</dc:creator>
      <dc:date>2019-06-20T14:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Update Shared Datasouce for Report using PowerShell</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1305608#M15607</link>
      <description>&lt;P&gt;I'm stuck at the exact same place. So baffled. Did you ever get this to work? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 00:35:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1305608#M15607</guid>
      <dc:creator>erico</dc:creator>
      <dc:date>2020-08-19T00:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Update Shared Datasouce for Report using PowerShell</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1306046#M15612</link>
      <description>&lt;P&gt;If you want to point to a different shared data source you need to use the&amp;nbsp;Set-RsDataSourceReference cmdlet&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 05:32:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1306046#M15612</guid>
      <dc:creator>d_gosbell</dc:creator>
      <dc:date>2020-08-19T05:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update Shared Datasouce for Report using PowerShell</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1308040#M15624</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="109790" data-lia-user-login="d_gosbell" class="lia-mention lia-mention-user"&gt;d_gosbell&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the quick response. After reading through the help file for&amp;nbsp;Set-RsDataSourceReference, the examples don't appear to align with my goal.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I ended up picking apart the function "Set-RsItemDataSource' and grabbing the last section.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://imgur.com/Y3B2OE6" target="_blank"&gt;https://imgur.com/Y3B2OE6&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" /&gt;&lt;BR /&gt;This ended up working and set my data source correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal was to set the report data source to this. Does this look sane?&lt;/P&gt;&lt;P&gt;&lt;A href="https://imgur.com/pSvkzTI" target="_blank"&gt;https://imgur.com/pSvkzTI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" /&gt;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 15:32:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1308040#M15624</guid>
      <dc:creator>erico</dc:creator>
      <dc:date>2020-08-19T15:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Update Shared Datasouce for Report using PowerShell</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1308945#M15635</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="253656" data-lia-user-login="erico" class="lia-mention lia-mention-user"&gt;erico&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;This ended up working and set my data source correctly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you figured out a script that works for you then that's great. If you are getting the result that you desire then that is probably proof in itself. I'm not sure how else you would measure the sanity of this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 22:43:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1308945#M15635</guid>
      <dc:creator>d_gosbell</dc:creator>
      <dc:date>2020-08-19T22:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update Shared Datasouce for Report using PowerShell</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1309191#M15638</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="109790" data-lia-user-login="d_gosbell" class="lia-mention lia-mention-user"&gt;d_gosbell&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe "safe" is a better word lol. The section of the function I took is different than your recommendation. My concern is about the downstream effects, despite its immediate success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your recommendation sets the DataSource like this...&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;$Proxy.SetItemReferences($item, @($dataSourceReference))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I set the DataSource like this...&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;$rsProxy.SetItemDataSources($rsItem, $newDataSource)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 00:56:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1309191#M15638</guid>
      <dc:creator>erico</dc:creator>
      <dc:date>2020-08-20T00:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Update Shared Datasouce for Report using PowerShell</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1309206#M15639</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="253656" data-lia-user-login="erico" class="lia-mention lia-mention-user"&gt;erico&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe "safe" is a better word lol. The section of the function I took is different than your recommendation. My concern is about the downstream effects, despite its immediate success.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Oh in terms of "safety" you should be very safe with calling api methods like this. I sometimes see people in this forum suggesting doing direct updates on the Report Server database and that is &lt;STRONG&gt;definitely&lt;/STRONG&gt; unsafe. But the powershell commands go through the supported web api calls which have a bunch of validations and checks in place and should ensure that there are no unwanted downstream effects.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 01:05:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/1309206#M15639</guid>
      <dc:creator>d_gosbell</dc:creator>
      <dc:date>2020-08-20T01:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Update Shared Datasouce for Report using PowerShell</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/3459941#M31306</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82180" data-lia-user-login="Per" class="lia-mention lia-mention-user"&gt;Per&lt;/a&gt;&amp;nbsp;any chance you can post the script in text here?&amp;nbsp; The link you provided no longer works.&amp;nbsp; I'm banging my head against the wall.&lt;/P&gt;&lt;P&gt;set-rsdatasourcereference -Path &amp;lt;path to report&amp;gt; -DataSourceName &amp;lt;current report datasource&amp;gt; -DataSourcePath &amp;lt;path to replacement shared data source&amp;gt; isn't working because I can't figure out the correct syntax for providing &amp;lt;current report datasource&amp;gt;.&amp;nbsp; It's a custom data source.&amp;nbsp; I used Get-RsItemDataSource which returns a System.Object with two properties:&amp;nbsp; Name = CM&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Item = Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy13er_SCCM_ReportService2010_asmx.DataSourceDefinition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried providing CM as the &amp;lt;current report datasource&amp;gt; parameter, but no joy.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 16:34:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Update-Shared-Datasouce-for-Report-using-PowerShell/m-p/3459941#M31306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-04T16:34:49Z</dc:date>
    </item>
  </channel>
</rss>

