Configuring backup in ConfigMgr Current Branch

With the introduction of Configuration Manager Current Branch (CB), the game of backup has changed slightly.  A SQL backup is still valid for restoring the database, but re-installing ConfigMgr CB must be started by running setup.exe from the cd.latest folder. I know most of you are backing up the virtual machine (which is good), but that should not prevent you from not stop you from backing up SQL and Configmgr. You have two options:

  • Create a SQL maintenance plan and include a custom step to backup cd.latest
    • SQL backup Pros
      • Support for compression
      • Better scheduling job
      • E-mail notifications
      • No ConfigMgr service interrupted
      • Include other databases in the backup job
  • Run the ConfigMgr built-in maintenance task
    • ConfigMgr Pros:
      • Easy to configure
      • You do not require any SQL experience
      • Run custom scripts after backup is completed using the old afterbackup.bat method
      • Include cd.latest and other ConfigMgr folders.

Personally I prefer the SQL method as I’m a big fan of compression and do not have time to copy 250 GB. Steve Thompson describes in this blog post how you can configure SQL backup for ConfigMgr 2012. My configuration is a long way exactly the same, except I will include a custom SQL Job. The SQL job will compress and copy .\Program files\Configuration Manager\cd.latest to the same location as my SQL backup files. The PowerShell job require, the SQL agent service to be running and the service account have permissions to the target path.

powershell.exe -command "Add-Type -Assembly ‘System.IO.Compression.FileSystem’ -PassThru | Select -First 1 | % { [IO.Compression.ZIPFile]::CreateFromDirectory(‘d:\program files\microsoft configuration manager\cd.latest’, ‘f:\sqlbck\archive’ + (Get-Date -format ‘yyyyMMddHHmm’) + ‘.zip’) }"

To create the job, follow these steps in SQL Management Studio:

  1. Open SQL Server Agent (ensure the SQL Agent service is running)
  2. Right click Jobs, create a New Job called Copy cd.latest and change the Owner to System (not required, but why not)
  3. Select the Steps page and click New. Configure the step with these values and click OK:
    1. Step name: copy cd.latest
    2. Type: Operating system (CmdExec)
    3. Run as: SQL Server Agent Service Account
    4. Command: Paste in the PowerShell command


  4. Click OK, to close the custom job.

In order to test the job, right click and select Start Job at Step.

Next step in the process is to configure a backup configmgr maintenance plan as described by Steve Thompson. I have followed the same steps, but will also include my custom copy cd.latest step in the plan.

  1. in SQL Management Studio, navigate to Management. Right click Maintenance Plans, and click Maintenance Plan Wizard.
  2. On the SQL Server Maintenance Plan Wizard page, click Next.
  3. Create a new plan with these settings:
    1. Name: SCCM Backup
    2. Run as: Select SQL Server Agent service account
    3. Select Single schedule for the entire plan or no schedule.
    4. Schedule: Click Change to configure a schedule
    5. Configure the schedule to match your backup criteria’s
  4. On the Select Maintenance Tasks page, select the following maintenance tasks:
    Clean Up History
    Back Up Database (Full)
    Maintenance Cleanup Task
    Execute SQL Server Agent Job


  5. On the Select Maintenance Tasks Order page move Execute SQL Server Agent Job to the end and click Next.
  6. On the Define History Cleanup Task page, configure Remove historical data older than 1 week(s) (or what ever value you want) and click Next.
  7. On the Define Back Up Database (Full) Task page, in the General tab click All databases
  8. Still on the Define Back Up Database (Full) Task page, click the Destination tab and configure these settings and click Next:

    Create a backup file for every database: enable Create a sub-directory for each database
    Set backup-compression: Compress backup.

  9. On the Define Maintenance Cleanup Task page, configure these settings and click Next:
    Delete files of the following type: Backup files
    Search folder and delete files based on an extension. In Folder, type you backup destination folder e.g. F:\SQLBCK, select Include first level subfolders and in File extension, type bak.
    File age configure Delete files based on the age of the file at task run time and Delete files older than 1 week(s).
  10. On the Define execute SQL Server Agent Job task page, select Copy cd.latest and click Next.


  11. Finish the wizard

Now is the time of truth, right click your maintenance plan and click Execute. Creating the zip file will take a few minutes, but once it’s done you have a complete backup set.


Huge thanks to my colleague Claus Codam for helping out with the PowerShell step.

By |2016-01-29T14:09:51+00:00January 29th, 2016|Configuration Manager (SCCM), General info|18 Comments

About the Author:

Kent Agerlund
Microsoft Regional Director, Enterprise Mobility MVP. Microsoft Certified Trainer and Principal consultant. I have been working with Enterprise client management since 1992. Co-founder of System Center User Group Denmark in 2009. Certified MCITP: Enterprise Administrator, MCSA+Messaing, and much more. Member of: Microsoft Denmark System Center Partner Expert Team The Danish Technet Influencers program System Center Influencers Program.


  1. Tim February 3, 2016 at 9:20 - Reply

    Hello, Great post!

    Can you explain how to configure this if you have a remote SQL server. So the Program filesConfiguration Managercd.latest isnt on the same server / drive / disk.


  2. Pascal February 3, 2016 at 19:26 - Reply

    Hi Kent,

    great script and tutorial. How about cleanup of the .zip-file? The regular SQL cleanup job won’t delete .zip-files older than X days, right?


    • Ryan January 23, 2019 at 22:46 - Reply

      Hi Pascal,

      Did you ever get an answer to this or do you need to update the powershell to remove the old copies of the cd.latest?

  3. Sveinung February 5, 2016 at 13:51 - Reply

    The CD.Latest folder is automatically copied by the SCCM Site Backup task in SCCM 1511.

    Layout in destination backup path when using same UNC for SQL/SCCM:

  4. Fred February 5, 2016 at 15:26 - Reply

    Does the SCCM Site Backup task work well for you in 1511 if backed up on UNC ?
    I get problems with cd.latest folder

    Error: Failed to backup \?GLOBALROOTDeviceHarddiskVolumeShadowCopy1PROGRAM FILESMICROSOFT CONFIGURATION MANAGERCD.LATEST up to \UNCBackupSCCMSMSBackupCD.Latest: ERROR: CTool::TreeCopy to \UNCBackupSCCMSMSBackupCD.Latest failed. Error = [error code: 5, error message: Access is denied.]. SMS_SITE_BACKUP 2016-02-05 08:29:38 1584 (0x0630)

    All other folders work and get backed up

    If I do it on local drive it works

    Security does not differ from other drives

    • olivier June 22, 2016 at 11:14 - Reply

      I had the same problem with the backup of CD.latest
      i add an exeption on viruscan to resolve this issue

      (Bloqué par une règle de protection de l’accès NT AUTHORITYSYSTEM SYSTEM:REMOTE G:SCCMBackupP03BackupCD.Latestautorun.inf Protection standard antivirus:Empêcher la création à distance de fichiers d’exécution automatique Action bloquée : Créer)

  5. Dan February 16, 2016 at 19:23 - Reply

    The following modification to the job will delete aging zip files in the backup directory. Some paths changed for my test environment.

    powershell.exe -command “Get-ChildItem -Path ‘D:SCCM_Backup*’ -Include ‘*.zip’ | Where-Object {$_.CreationTime -lt (Get-Date).AddDays(-7)} | Remove-Item; Add-Type -Assembly ‘System.IO.Compression.FileSystem’ -PassThru | Select -First 1 | ForEach-Object { [IO.Compression.ZIPFile]::CreateFromDirectory(‘c:program filesmicrosoft configuration managercd.latest’, ‘D:SCCM_Backupcdlatest’ + (Get-Date -format ‘yyyyMMddHHmm’) + ‘.zip’) }”

    • Alex March 7, 2018 at 15:34 - Reply

      Thank you for the hint Dan. Interesting though it works fine from command line, but being added to SQL job it does nothing (zipping still works).

  6. Andrew Lukaszewski May 16, 2016 at 14:55 - Reply

    Not sure I completely agree with the SQL only method for SCCM backup as it has always been considered a last chance method of restoration if you do not have a full Configuration Manager backup available. The CM backup has long been the preferred method of SCCM backup and I’m not sure Microsoft would say otherwise . Also, think of all of the existing log files and inboxes files that are coming in from client systems/in process/not yet committed to database and not included in a database only backup.

  7. Steve Thompson May 20, 2016 at 23:52 - Reply

    Andrew – Microsoft supports restore from a native SQL backup since CM 2012 Sp1. Disagree with last ditch, SQL backups are better for a lot of reasons. For more information please see:

  8. […] Configuring backup in ConfigMgr Current Branch […]

  9. Gary Knigge August 17, 2016 at 16:24 - Reply

    Since it is now necessary when restoring a site to install 1511, then 1606 (or whatever was current when something bad happened), is it still valuable to backup cd.latest? Is there a time when that would be helpful? I imagine there is, I just can’t think of it. -Thank you. Gary

    P.S. Cleanup of older cd.latest zip files created in the powershell job can be accomplished with Maintenance Cleanup task attached to the backup Maintenance plan that calls the cd.latest backup. Just specify zip extension instead of bak.

  10. Bongani September 7, 2016 at 8:47 - Reply

    Good day Guys,

    I am used to design SCCM relaying on Active directory sites and services.
    One of our new clients – are upgrading their network moving away from a point to point topology to an MPLS Cloud network setup.

    Normally you would specify on the Domain controller the subnet mask of other sites that are close by – so that when the users authenticate – they authenticate on a local AD server and the same sites are discovered and used in SCCM.
    Now with the MPLS, all packets go to the cloud first before they are redirected to the destination. Packets look for the shortest path.
    What makes this even complicated is that in this setup is that – I am not sure whether do I still specify subnets in my AD sites and services – since a user logging on a local site -what happens is that first the log on request is sent to the MPLS Cloud.

    Please advise me on where to place my domain and Secondary site or Distribution Point.
    Also I was trying to avoid deploying the Central Administration Site on the same environment since there is no need for separate Primary Sites.
    What is requested is High Availability and Site resilience on the 2 head office datacenters.
    Thanks in advanced for this


  11. keyword 2 November 20, 2016 at 22:44 - Reply

    Definitᥱly imagine that which you stated. Your favourite justification appeared to be on the intᥱrnet thᥱ eаsiest factߋr to beaг
    in mind of. I say to you, I definitely get annoyed at the same time as folks think about concerns that thᥱy pⅼainly dⲟn’t reсognise about.

    You contrоllᥱd to hit the nail upon the highest as neatly as defined out the whole thing with no need side effect , people can take a signal.
    Wiⅼl likely be bacк to get more. Thanks

    my weblog keyword 2

  12. […] like me, you followed Kent Agurlund’s excellent guide on how to create SCCM backups using SQL you will have noticed that while it will only keep the last 7 backups, when you come to configure […]

  13. […] for SCCM CB recovery if you made at least one in-console upgrade for your SCCM. The article is here. Unfortunately his powershell script does not clean old cd.latest archives and that can be a […]

  14. […] Kent Agerlund [MVP] wrote a great article describing various ways to backup ConfigMgr. In his article he describes how to create a SQL Server Agent job that copies and compresses the cd.Latest folder. Run through the steps he outlines to create the job.… […]

  15. […] most important part is the backup of your database. SCCM built-in task or an SQL backup is a debatable option. Some like the built-in one, other the SQL one, I like to recommend having […]

Leave A Comment