{"id":2327,"date":"2016-10-19T21:19:36","date_gmt":"2016-10-19T19:19:36","guid":{"rendered":"http:\/\/blog.hosebei.ch\/?p=2327"},"modified":"2016-10-19T21:19:36","modified_gmt":"2016-10-19T19:19:36","slug":"configrmgr-the-complete-backup-currently","status":"publish","type":"post","link":"https:\/\/blog.hosebei.ch\/?p=2327","title":{"rendered":"ConfigrMgr &#8211; The complete Backup (currently)"},"content":{"rendered":"<p>Motivated from my attend at IT\/Dev Connection in Las Vegas, I wanted to create my complete Backup from ConfigMgr so far.<br \/>\nBecause I was required to copy a lot of work from other people together, I decided to create a blog with each detailed step to achieve a fine Backup at the end, and I will start from the beginning, until we have reached our goal:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup012.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup012.png?w=300\" alt=\"SQL Backup Maintenance\" width=\"300\" height=\"178\" class=\"aligncenter size-medium wp-image-2328\" \/><\/a><br \/>\n<!--more--><\/p>\n<p>First make sure you can access the SQL Management Studio, and that you are able to create a Database, which is required to store some Stored Procedures from an active community contributor which I will outline later on. I have created that all on my LAB, so SQL and ConfigMgr are installed on the same virtual Machine, this may also be true for smaller Organizations.<br \/>\nWhen you have opened your SQL Management Studio, create a new Database, mine is called &#8220;DatabaseMaintenance&#8221;:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup02.png\" alt=\"Created Database\" width=\"244\" height=\"167\" class=\"aligncenter size-full wp-image-2329\" \/><\/a><br \/>\nAfter creating the Database you can navigate to the to the SQL Server Agent and open the node Jobs, right-click on Jobs and Select \u201cNew Job\u2026\u201d:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup12.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup12.png?w=205\" alt=\"SQL Server Agent Job\" width=\"205\" height=\"300\" class=\"aligncenter size-medium wp-image-2343\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup12.png 316w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup12-205x300.png 205w\" sizes=\"auto, (max-width: 205px) 100vw, 205px\" \/><\/a><br \/>\nEnter a name for the Job, and switch to Steps:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup29.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup29.png?w=300\" alt=\"SQL Powershell Delete Files\" width=\"300\" height=\"271\" class=\"aligncenter size-medium wp-image-2375\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup29.png 701w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup29-300x271.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nClick on &#8220;New&#8230;&#8221; to add a new step to this job, make sure that you change the type to &#8220;Operating System (CmdExec)&#8221; and copy to following (modified) powershell command to the Command Text block:<br \/>\n<code>powershell.exe -command \"While(([math]::round(((Get-ChildItem -Path '\\\\deheim.hosebei.ch\\hosebeiDFSroot\\Backup_Folder\\SCCM_BackupLocation\\hosebeisccm01\\SQL_Backup_S01' -Recurse) | Measure-Object -Property Length -Sum).sum \/ 1024 \/ 1024 \/ 1024)) -gt 10) { Remove-Item (Get-ChildItem -Path '\\\\deheim.hosebei.ch\\hosebeiDFSroot\\Backup_Folder\\SCCM_BackupLocation\\hosebeisccm01\\SQL_Backup_S01' | Sort CreationTime | select -First 1).Fullname -Recurse -Force}\"<\/code><br \/>\nThis will delete the oldest Files within the given UNC Path, if the Size of the folder is greater than 10 Gigabyte. Be sure that the selected &#8220;SQL Server Agent Service Account&#8221; has writable access to the destination Folder, which you might to change on the given example above. The Step should then look like this:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup30.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup30.png?w=300\" alt=\"PoSh SQL Delete Files\" width=\"300\" height=\"167\" class=\"aligncenter size-medium wp-image-2376\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup30.png 1127w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup30-300x167.png 300w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup30-1024x572.png 1024w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup30-768x429.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nClose the Job by clicking OK Twice.<br \/>\nIf you consider to use the type &#8220;PowerShell&#8221;, <strong>DARE YOU<\/strong>! It is not working, or only limited functionality is given. See this wonderful Blog from <a href=\"http:\/\/www.sqlhammer.com\/running-powershell-in-a-sql-agent-job\/\" target=\"_blank\">SQL Hammer<\/a>.<br \/>\nThen navigate through the Management Tree and right-click on &#8220;Maintenance Plan&#8221; to select &#8220;New Maintenance Plan&#8230;&#8221;:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup03.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup03.png?w=290\" alt=\"New Maintenance Plan\" width=\"290\" height=\"300\" class=\"aligncenter size-medium wp-image-2331\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup03.png 395w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup03-290x300.png 290w\" sizes=\"auto, (max-width: 290px) 100vw, 290px\" \/><\/a><br \/>\nAfter a click on save, and by refreshing the Tree, your newly created maintenance Plan will show up. The newly created maintenance plan is not scheduled yet, keep in mind, that a scheduled  maintenance plan gets disabled, if the plan is changed after activating the schedule. You will have to manually enable the Job under SQL Server Agent again.<br \/>\nYou should now have an empty Maintenance Plan in Front of you, when you double-click on the Subplan, you can change the description or name:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup04.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup04.png?w=300\" alt=\"Maintenance Plan Subplan\" width=\"300\" height=\"268\" class=\"aligncenter size-medium wp-image-2333\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup04.png 426w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup04-300x268.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nTo add the first step of the maintenance Plan, open the Toolbox through View:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup05.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup05.png?w=271\" alt=\"Maintenance Plan Toolbox\" width=\"271\" height=\"300\" class=\"aligncenter size-medium wp-image-2334\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup05.png 304w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup05-271x300.png 271w\" sizes=\"auto, (max-width: 271px) 100vw, 271px\" \/><\/a><br \/>\nFrom the toolbox, double-click on &#8220;Execute SQL Server Agent Job Task&#8221;, and the step will be added to the Subplan. This first step will delete existing files from the Backup folder created in the job with the powershell Script before. Now double click on the added step:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup071.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup071.png?w=257\" alt=\"configmgr_backup07\" width=\"257\" height=\"300\" class=\"aligncenter size-medium wp-image-2377\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup071.png 318w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup071-257x300.png 257w\" sizes=\"auto, (max-width: 257px) 100vw, 257px\" \/><\/a><br \/>\nAnd select the previously created job from the list. Again, make sure that the User Account which runs the SQL Server Agent need to be able to perform those file operations on the target path:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup31.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup31.png?w=300\" alt=\"Select Job\" width=\"300\" height=\"224\" class=\"aligncenter size-medium wp-image-2378\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup31.png 566w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup31-300x224.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nTo rename the steps, just click on the name, and the known rename appearance will be shown. If you have finished the manipulations of the first step, Open the Toolbox again and add a step named &#8220;History Cleanup Task&#8221;, move the step an appropriate position, and connect it from the &#8220;Delete old files&#8221; step:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup101.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup101.png?w=300\" alt=\"Cleanup Step\" width=\"300\" height=\"61\" class=\"aligncenter size-medium wp-image-2379\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup101.png 625w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup101-300x61.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nClick on save, the maintenance plan will be stored, we have to leave the creative process and set up our maintenance Database. This process is quite simple, and I take it from <a href=\"https:\/\/ola.hallengren.com\/sql-server-index-and-statistics-maintenance.html\" target=\"_blank\">Ola Hallengren<\/a>. He explains on his website how to use his work, I really want to point out that I&#8217;m a user of those as well. Just simply download the file called MaintenanceSolution.sql and run it within your SQL, mind to change the targeted Database:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup11.png?w=300\" alt=\"Create MaintenanceDB\" width=\"300\" height=\"236\" class=\"aligncenter size-medium wp-image-2341\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup11.png 659w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup11-300x236.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nThis will store the changes within your own database, rather than the master DB, which would work too. Now navigate to the SQL Server Agent and open the node Jobs, right-click on Jobs and Select &#8220;New Job&#8230;&#8221;:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup12.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup12.png?w=205\" alt=\"SQL Server Agent Job\" width=\"205\" height=\"300\" class=\"aligncenter size-medium wp-image-2343\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup12.png 316w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup12-205x300.png 205w\" sizes=\"auto, (max-width: 205px) 100vw, 205px\" \/><\/a><br \/>\nEnter the name &#8220;Index Rebuild and Statistic Refresh&#8221; and click on Steps:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup13.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup13.png?w=300\" alt=\"Step1\" width=\"300\" height=\"80\" class=\"aligncenter size-medium wp-image-2344\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup13.png 700w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup13-300x80.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nClick on &#8220;New&#8230;&#8221; and enter the Name &#8220;Rebuild Index&#8221;, add the T-SQL command A from <a href=\"https:\/\/ola.hallengren.com\/sql-server-index-and-statistics-maintenance.html\" target=\"_blank\">Ola Hallengren<\/a>. Make sure to change the Database to your Maintenance Database:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup14.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup14.png?w=300\" alt=\"rebuild index\" width=\"300\" height=\"269\" class=\"aligncenter size-medium wp-image-2345\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup14.png 705w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup14-300x269.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nFinish this step by clicking on OK. within the &#8220;New Job&#8221; Wizard click on &#8220;New&#8230;&#8221; again, and add a Step named &#8220;Statistic Refresh&#8221;, take as T-SQL command the C from <a href=\"https:\/\/ola.hallengren.com\/sql-server-index-and-statistics-maintenance.html\" target=\"_blank\">Ola Hallengren<\/a>:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup15.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup15.png?w=300\" alt=\"Statistic Refresh\" width=\"300\" height=\"269\" class=\"aligncenter size-medium wp-image-2346\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup15.png 703w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup15-300x269.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nClick on OK twice to close the Step and finish the Job Wizard. You can now go ahead to the Maintenance Plan, and add through the toolbox a step named &#8220;Execute SQL Server Agent Job Task&#8221;, connect it with the parent step, and rename the step as you like. Double-Click the step and select the previously created Job:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup161.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup161.png?w=300\" alt=\"Step Job\" width=\"300\" height=\"104\" class=\"aligncenter size-medium wp-image-2348\" \/><\/a><br \/>\nHere is the Job Task selection wizard:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup17.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup17.png?w=300\" alt=\"configmgr_backup17\" width=\"300\" height=\"224\" class=\"aligncenter size-medium wp-image-2349\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup17.png 563w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup17-300x224.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nNow it is time to implement the Windows Server Update Service cleanup script, which can be download from Microsoft:<br \/>\n<a href=\"https:\/\/gallery.technet.microsoft.com\/scriptcenter\/6f8cde49-5c52-4abd-9820-f1d270ddea61\">Re-index the WSUS 3.0 Database<\/a><br \/>\nJust copy the Script Block to the Clipboard, we will insert it in the T-SQL Statement which will be added right now. Open the Toolboox and add a &#8220;Execute T-SQL Statement Task&#8221;, connect it to the previous step, and rename it if you like:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup181.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup181.png?w=300\" alt=\"WSUS Cleanup step\" width=\"300\" height=\"151\" class=\"aligncenter size-medium wp-image-2352\" \/><\/a><br \/>\nInsert the T-SQL Statement from the clipboard, check if there is a hidden char after the &#8220;GO&#8221; command (there are three), which may fail the execution:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup19.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup19.png?w=300\" alt=\"WSUS Statement\" width=\"300\" height=\"224\" class=\"aligncenter size-medium wp-image-2353\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup19.png 562w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup19-300x224.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nNow it is time to back up the Databases, go to the Toolbox and add &#8220;Back Up Database Task&#8221;, connect the added Task, and Rename it if necessary:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup201.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup201.png?w=300\" alt=\"Backup DB\" width=\"300\" height=\"177\" class=\"aligncenter size-medium wp-image-2355\" \/><\/a><br \/>\nDouble-Click on the added Backup Task and select the Databases you like to back up (in my Case: ConfigMgr DB, SUSDB and MaintenanceDB):<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup21.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup21.png?w=300\" alt=\"Backup DB Selection\" width=\"300\" height=\"263\" class=\"aligncenter size-medium wp-image-2357\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup21.png 703w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup21-300x263.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nMake sure that you select compress backup within the Options Tab, and it is always a good idea to select checksum and backup integrity:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup221.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup221.png?w=300\" alt=\"SQL Backup Options\" width=\"300\" height=\"245\" class=\"aligncenter size-medium wp-image-2361\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup221.png 701w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup221-300x245.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nWhen this is done, you can now add the step to create the zip-compressed file of the CD.Latest Folder, but first we have to create a Job for this, so navigate to the SQL Server Agent right-click on &#8220;Jobs&#8221; and select &#8220;New Job&#8230;&#8221;, name the job as you like:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup23.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup23.png?w=300\" alt=\"Copy cd.latest\" width=\"300\" height=\"270\" class=\"aligncenter size-medium wp-image-2362\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup23.png 704w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup23-300x270.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nNow go ahead and select the steps, and click on &#8220;New&#8230;&#8221; to add a step to this Job. Choose a name you like for this step, and copy paste the command from Kent Agerlund (<a href=\"http:\/\/blog.coretech.dk\/kea\/configuring-backup-in-configmgr-current-branch\/\">Source<\/a>), make sure to change the type to Operating System:<br \/>\n<code>powershell.exe -command \"Add-Type -Assembly \u2018System.IO.Compression.FileSystem\u2019 -PassThru | Select -First 1 | % { [IO.Compression.ZIPFile]::CreateFromDirectory(\u2018d:\\program files\\microsoft configuration manager\\cd.latest\u2019, \u2018\\\\deheim.hosebei.ch\\hosebeiDFSroot\\Backup_Folder\\SCCM_BackupLocation\\hosebeisccm01\\SQL_Backup_S01\\cd.latest_\u2019 + (Get-Date -format \u2018yyyyMMddHHmm\u2019) + \u2018.zip\u2019) }\"<\/code><br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup241.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup241.png?w=300\" alt=\"CD.Latest Job\" width=\"300\" height=\"167\" class=\"aligncenter size-medium wp-image-2363\" \/><\/a><br \/>\nMind to change the two folders to respect your ConfigMgr Installation and the Backup Path from your environment. For your Information: This powershell command is a fire-and-forget step, it does not wait for the powershell command to finish, the plan will continue the Maintenance Plan after the execution of the command. You can then close the Job by click on OK twice.<br \/>\nAfter the creation of this Job, you can go back to your Maintenance Plan, open the Toolbox and add a &#8220;Execute SQL Server Agent Job Task&#8221; to your Subplan. Connect this step with the following &#8220;Back Up Database Task&#8221; and rename the step if you like, your Subplan should look like the following:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup251.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup251.png?w=300\" alt=\"Maintenance Plan\" width=\"300\" height=\"183\" class=\"aligncenter size-medium wp-image-2365\" \/><\/a><br \/>\nDouble-Click on the added step, and select the previously created Job:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup26.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup26.png?w=300\" alt=\"Select Job\" width=\"300\" height=\"223\" class=\"aligncenter size-medium wp-image-2366\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup26.png 567w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup26-300x223.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nNow you are all set, and at last, you need to schedule the maintenance plan, just click on the calendar icon wihtin you subplan:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup32.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup32.png?w=300\" alt=\"Schedule SQL Maintenance Plan\" width=\"300\" height=\"86\" class=\"aligncenter size-medium wp-image-2391\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup32.png 658w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup32-300x86.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nWithin the following wizard, you can configure how often this should run:<br \/>\n<a href=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup33.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup33.png?w=300\" alt=\"New Job Schedule\" width=\"300\" height=\"263\" class=\"aligncenter size-medium wp-image-2392\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup33.png 676w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2016\/10\/configmgr_backup33-300x263.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Hope this helps, and if som one can provide a one-liner for exporting al Task Sequence (see this template <a href=\"https:\/\/blogs.technet.microsoft.com\/letsdothis\/2015\/06\/17\/powershell-export-all-configmgr-2012-r2-task-sequences\/\">Link<\/a>), I&#8217;m happy to update my blog post \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Motivated from my attend at IT\/Dev Connection in Las Vegas, I wanted to create my complete Backup from ConfigMgr so far. Because I was required to copy a lot of work from other people together, I decided to create a blog with each detailed step to achieve a fine Backup at the end, and I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,19,33,36,38,40],"tags":[],"class_list":["post-2327","post","type-post","status-publish","format-standard","hentry","category-configmgr","category-general","category-sccm","category-setup","category-sql","category-tools"],"_links":{"self":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/2327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2327"}],"version-history":[{"count":0,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/2327\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}