How to Backup SCCM Reports
A question that I get asked regularly is how to backup SCCM reports. This is required when SCCM administrators are moving from System Center Configuration Manager (SCCM) 2012 to SCCM Current Branch. Or, when someone’s SCCM site server has a disaster and they need to restore it from a backup. It is not until after they restore the SCCM site server, that they can’t find the reports that they created. In a 2016 blog post, I talked about how to backup a SCCM report. In that blog post, I said that you could follow those steps only if you needed to backup a handful of reports. Otherwise, you’d need to use something else to do a bulk backup of custom SCCM reports.
The PowerShell script that I used to backup my SCCM reports in 2016 and still continue to use was created by Donabel Santos @sqlbelle. She is a SQL Server MVP and the author of SQL Server 2012 with PowerShell V3 Cookbook. On her blog, you will find a post entitled, “How to Download All Your SSRS Report Definitions (RDL files) Using PowerShell.” This is where you will find the PowerShell script that I use.
If this all sounds familiar it’s because I told you about it in a previous post. New in this blog post, I will not only show you how to update the PowerShell script, but I will show you how I edit the script to allow for automatic backups of SCCM reports using the Task Scheduler. These small edits will allow you to back up your RDLs every day!
Backup SCCM Reports
1. Grab the PowerShell script from Donabel’s blog post.
2. Paste the whole script into an elevated PowerShell ISE.
3. Edit Line 5 to list your Reporting Point Server. Keep in mind that if you have a SQL Server Reporting Services (SSRS) instance, your URI will need to include your instance name too. My Reporting Point is on cm-cas-cb1. I highlighted the line you need to edit in the screenshot below.
4. Ensure that you have a C:\temp directory.
5. Execute the script. For my environment, the script was done within two minutes!
This script is great, but it does have one minor downside. The downside is that it will also backup all of your built-in SCCM reports too. In my opinion, I would rather have more than less, so this really isn’t a downside for me. By doing this, I’m assured that all of my custom reports and the built-in reports are backed-up. By the way, it only takes less than 65 MB to back-up all of the RDLs for my site. Not bad!
Testing the Access to ReportService2005.asmx
If you get an error when running the script, how can you test the URI that was listed in Line 5? It’s fairly simple. Copy the URI from Line 5 and paste it into your browser. If the URI is correct, you will get a page that looks similar to the one below.
How to Perform a Backup of SCCM Reports Every Day
This script is only good for a one-time backup. It will create a directory with the current date and time, so this is not useful in the long run especially if you want to backup SCCM reports every day. I also recommend backing your reports up every day, so how can you do this? Simply make one change to the script and then setup a task schedule. Notice that the date and time are added to the backup folder on Line 21.
Simple change the value to, “Daily.”
Now, when you run the script again, it will overwrite the RDL. The next step is to schedule this script as a Windows schedule task. It’s that simple!
If you have any questions about how to backup SCCM reports, please feel free to contact me at @GarthMJ.