ConfigMgr Console

How to Backup SCCM Reports

Topics: ConfigMgr Console

How to Backup SCCM Reports

Including Custom and Single 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 this Post:

How to Backup 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.

Here I will not only show you how to update the PowerShell script, but also 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!

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.

Backup SCCM Reports - Line 5

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.



Backup SCCM Reports - URI

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.



Backup SCCM Reports - Line 21

Simple change the value to, “Daily.”



Backup SCCM Reports - 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!

How to Backup a Single SCCM Report

Every so often, this question comes up within the Microsoft Forums or on the MyITForum mailing list: How can I backup my Custom SCCM Report? There are many reasons why someone would not have a copy of their SCCM report. Ultimately, it doesn’t matter why, particularly when the solution is simple. The answer is to download a copy of the RDL on to your computer, but exactly how do you do that?

  • Start by opening Internet Explorer and go to your System Center Configuration Manager Reporting Site. In my example, this is: http://cm-cas-rs1/Reports/.
  • Browse to the report that you want to backup.
  • Place your cursor over the report to display the menu button.
  • Click the download link.

This will download the report to your local computer; from there, you can copy it to anywhere that it can be backed up.

This is useful for a handful of reports, but once you have more than that, you should look at using a PowerShell script to back up all of your RDLs at one time.

How to Backup All of Your Custom ConfigMgr Reports

The above process is good for a handful of reports, but you need to use PowerShell or something else to back up all of your custom ConfigMgr reports. Here is how to backup all of your custom reports.

The script that I use to back up all of my ConfigMgr reports was created by Donabel Santos @sqlbelle. She is a SQL MVP and 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.”

1. Copy and paste the whole script into PowerShell ISE.

2. Edit Line 4, so that your Reporting Point Server is listed. Keep in mind that if you have an SSRS instance, your URI will need to include your instance name too. My Reporting Point is on cm-cas-rs1. I highlighted the line you need to edit.

3. Ensure that you have a C:\temp directory.

4. Execute the script.

This script is great, but it does have a minor downside. The downside is that it will also back up all of your default ConfigMgr reports too, but IMO, I would rather have more than less! By doing this, I’m assured that I’ll have all of them, plus backing up all of the RDLs for my site is less than 65MB total.

How to Automatically Backup ConfigMgr Reports Using AfterBackup.bat

I love the process above, but it is a one-time backup. So how do you backup all of your ConfigMgr reports every time your ConfigMgr site gets backed up? If you are using the built-in ConfigMgr backup task, the answer is simple: edit your AfterBackup.bat.

In a post from 2015, I used a PowerShell script to make a copy of the ConfigMgr backup for 7 days. This time I will edit the AfterBackup.bat and add a second PowerShell script to backup the ConfigMgr reports.

The Steps

1. First, in order to create and test the PowerShell (PS) script, review the blog post, “How Do You Backup All of Your Custom ConfigMgr Reports?”It is important that this step be completed BEFORE proceeding to the next step.

2. Copy the PowerShell script to your ConfigMgr site server under <Install Directory>\inboxes\smsbkup.box\ ConfigReportsBak.ps1.

3. Edit the PowerShell script and change Line 21 to your ConfigMgr backup directory; add the folder called Reports. In my example below, D:\CMbak\RS2Backup\Reports, I highlighted the line. You will notice that the Data&Time variable is no longer used.

4. Edit the AfterBackup.bat and add the following line to it. Note: Watch out for word wrapping as well as the stylized quote for both the single and double quotes.

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -nologo -ExecutionPolicy Bypass -file “D:\Program Files\Microsoft Configuration Manager\inboxes\smsbkup.box\ConfigReportsBak.ps1”

5. Test the backup; make sure that the reports are backed up.

Once this is done, your ConfigMgr reports will be backed up every time the ConfigMgr backup occurs.

Final Notes: Automatically Backup ConfigMgr Reports Using AfterBackup.bat

I can hear some of you protesting because many MVPs do NOT recommend using the ConfigMgr backup process in ConfigMgr Current Branch. Let me be the first to say that I’m not one of those MVPs that advises only to use the SQL backups. Having said that, how can you do this as part of the SQL backup process? In a blog post next week, I will show you how to do the same thing using the SQL agent.


Additional ConfigMgr Backup Posts

computer lab at night

Actionable dashboards? Yes, please with Right Click Tools Enterprise.

LAPS, BitLocker, and software update compliance all in an easy-to-view format with remediation just a right click away.

Back to Top