Close Menu
    Facebook X (Twitter) Instagram
    Sunday, October 12
    X (Twitter) LinkedIn Reddit RSS
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»CM2012»SCCM Configmgr 2012 How to change Custom Data source to Shared Data Source for multiple SSRS reports

    SCCM Configmgr 2012 How to change Custom Data source to Shared Data Source for multiple SSRS reports

    Eswar KonetiBy Eswar KonetiApril 29, 1:07 pm3 Mins Read CM2012 5,930 Views
    Share
    Facebook Twitter LinkedIn Reddit

    Background: I had a requirement to not allow others except Configmgr admins to deny access to Configmgr 2012 Console, also to Configmgr SQL Database access (this can be done by revoking access from SSRS_Read Group.If the users are part of this group,they can install SQL and try to connect to configmgr database remotely to run queries).How do we provide access to service Desk /Others to access reports In General? Create AD security group,add this group to SMS Admins (to get access to the SMS Provider) on Configmgr server,Create new Security role in Configmgr by providing Run report permissions and add the AD sec group to administrative users by selecting the above created security scope.

    So far,everything is fine but the problem here is,we usually create SSRS reports using custom tools like Business intelligence studio(Visual Studio) .

    so during the process of new Report creation,we mostly go with Data  source connection string as ‘Data Source=SQLserverName;Initial Catalog=DatabaseName’. once you are done with reports,we publish them to SSRS by Uploading the RDL file or auto publish from BIDS. How to publish the custom reports to specific folder in SSRS available here

    what happens when end users browse these reports ? they get access denied since they are not allowed to connect to SQL server(they are not part of SSRS_Read group) ,what is used in above Reports. So you are required to change the Data source to Shared Data source(default Data source for Configmgr).

    image

    For single report,you can do this by going to report properties—data source and select the Shared Data source from Configmgr_P01 as shown below:

    image

    But what,if you want to do this change for multiple custom reports ,manual method is not preferable.

    Here is the powershell script to change form Custom Data Source to Share data source for multiple reports under specific folder.

    Reference : https://ask.sqlservercentral.com/questions/86369/change-datasource-of-ssrs-report-with-powershell.html

    #Set variables:
    #Change the Configmgr Report server name
    $reportserver = "sccm2012pri";
    $url = "
    http://$($reportserver)/reportserver/reportservice2005.asmx?WSDL";
    #Provide New Data source Path ,you need to replace this with correct one from your SSRS report
    $newDataSourcePath = "/ConfigMgr_P01/{5C6358F2-4BB6-4a1b-A16E-8D96795D8602}"
    #Provide new Data source Name which is part of above source path
    $newDataSourceName = "{5C6358F2-4BB6-4a1b-A16E-8D96795D8602}";
    # provide Report folder path that contains reports to change the Data source.in my case,i want to change DS for all reports under eskonr/eswar/sup folder.If you have multiple folders to change the Data source,you need to run the script by changing the folder name .
    $reportFolderPath = "/eskonr/eswar/SUP"
    #------------------------------------------------------------------------
    $ssrs = New-WebServiceProxy -uri $url -UseDefaultCredential
    $reports = $ssrs.ListChildren($reportFolderPath, $false)
    $reports | ForEach-Object {
    $reportPath = $_.path
    Write-Host "Report: " $reportPath
    $dataSources = $ssrs.GetItemDataSources($reportPath)
    $dataSources | ForEach-Object {
    $proxyNamespace = $_.GetType().Namespace
    $myDataSource = New-Object ("$proxyNamespace.DataSource")
    $myDataSource.Name = $newDataSourceName
    $myDataSource.Item = New-Object ("$proxyNamespace.DataSourceReference")
    $myDataSource.Item.Reference = $newDataSourcePath
    $_.item = $myDataSource.Item
    $ssrs.SetItemDataSources($reportPath, $_)
    Write-Host "Report's DataSource Reference ($($_.Name)): $($_.Item.Reference)";
    }
    Write-Host "------------------------"
    }

    I have also attached the powershell script here for your reference, incase of any syntax errors.

    Note: replace the quotes as blog converts them to fancy.

    Bold letters refers require change.

    Hope it helps others who wants to change the Custom Data source to Shared Data source.

    Change Data source configmgr Custom Data Source Custom Data source for multiple reports Powershell Reports SCCM SCCM 2012 script Shared Data source
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    Export Microsoft Entra ID User Authentication Methods to CSV using PowerShell & Microsoft Graph API

    August 13, 2:08 pm

    SCCM SQL Report – Compare Installed Apps on TWO Different Computers

    July 13, 10:35 am

    Exporting Intune Win32 Apps with All Properties Using PowerShell and Microsoft Graph

    June 30, 7:01 pm

    2 Comments

    1. Tim on October 28, 2014 11:49 PM

      A mention to the author would have been nice.

      https://ask.sqlservercentral.com/questions/86369/change-datasource-of-ssrs-report-with-powershell.html

      Reply
      • Eswar Koneti on October 29, 2014 6:35 PM

        Didn't i link it as reference article? I should.. I will update with this link. Thanks tim.

        Reply

    Leave a ReplyCancel reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Sign Up

    Get email notifications for new posts.

    Author

    I’m Eswar Koneti ,a tech enthusiast, security advocate, and your guide to Microsoft Intune and Modern Device Management. My goal? To turn complex tech into actionable insights for a streamlined management experience. Let’s navigate this journey together!

    Support

    Awards

    Archives

    © Copyright 2009-2025 Eswar Koneti, All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.