Migrate SSRS Subscription Owners with PowerShell

This post has been republished via RSS; it originally appeared at: Microsoft Developer Blogs.

App Dev Manager Reed Robison shares an example of how to automate the assignment of SSRS subscription owners. If you are migrating SSRS content to a new server, this is fairly easy to do and documented in a number of articles like Sample Reporting Services rs.exe Script to Copy Content between Report Servers.  You may find that after you move the content that subscription owners are automatically set to the account used to perform the migration.  There is an API you can use to assign a new owner and scripts to list subscriptions owners, but if you have to do this for a large number of servers, it can be a lot of work.  With that in mind, I wrote a script to help automate the assignment of subscriptions owners based on the source content. This script assumes you have migrated the Reporting Services content with RS.EXE similar to the process documented here.  RS.EXE copies the content following the limitations outlined in the article.  There should be subscriptions that were migrated but they will have inherited the permissions of the account used to do the migration, which you want to change. The script is based on the samples provided in Manage Subscription Owners and Run Subscription - PowerShell.  Those samples include generic scripts to list owners, assign owners, etc.  They use the ChangeSubscriptionOwner API. Description The script (MoveOwner_All_SSRS_Subscriptions) takes a source server and a destination server as well as credentials used to manage each.  It enumerates subscriptions on the source server and attempts to find a matching subscription on the destinations server.  Since the new subscription will have a different GUID after migration, it attempts to do this by comparing path, server, and description.  Assuming you migrated the content with rs.exe, those properties should have been preserved.  If it finds a match, it looks at the original owner and attempts to assign that owner to the destination subscriptions using the new GUID for the subscription. Limitations & Considerations This script assumes we’re migrating native modes only, not SharePoint mode.  You could easily modify the script to handle the SharePoint scenario as well. The script is configured for HTTP.  If you enforce HTTPS, you will need to modify the proxy reference to use https instead of http. When the ChangeSubscriptionOwner API attempts to assign the owner, it will need to successfully validate the account – so the account used to connect to the destination server will need proper permission to do this. Syntax: Powershell MoveOwner_All_SSRS_Subscriptions.ps1 “[server]/reportserver” “[source domain]\[user]” “[source user password]” “[dest server]/reportserver“ “[dest domain]\[user]” “dest user password” *This syntax is similar to what you probably used with rs.exe   Example (where the source server is server1 and the destination server is server2 and both systems are configured with a user authorized as “Demo” and password set to “Password101”: Powershell c:\rs_scripts\MoveOwner_All_SSRS_Subscriptions.ps1 "server1/reportserver" "server1\Demo" "Password101" "server2/reportserver" "server2\Demo" "Password101"   MoveOwner_All_SSRS_Subscriptions.ps1  

REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

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