Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 36188

Automate Disable and Re-enable of Configuration Manager Maintenance tasks for upgrade

$
0
0

When running an in-place upgrade to System Center Configuration Manager you should record and disable maintenance tasks so they will not run during the site upgrade.

https://docs.microsoft.com/en-us/sccm/core/servers/deploy/install/upgrade-to-configuration-manager

In a small environment with one or two sites this is pretty easy and can be recorded using Powershell or even a screen shot. After the site upgrade is complete the maintenance tasks can be re-enabled. In a large environment that has more sites you may want to look at automating the process of recording current status, disabling tasks, and then re-enabling after the upgrade.

 

This script can be run from the CAS or a Primary site server in the hierarchy and will perform the following actions:

1) Record and disable all maintenance tasks
When the script is run with no parameters it will record current maintenance task status in an XML file and disable maintenance tasks in all Config Mgr sites.
C:CM-MaintenanceTasks-$date.xml

Now that all maintenance tasks have been recorded and disabled we can schedule and complete the Configuration Manager upgrades for all sites. Once the upgrade is complete we can use the script to re-enable the maintenance tasks based on recorded values in the CM-MaintenanceTasks-$data.xml file

2) Re-enable all site maintenance tasks
Run script with parameter -enabletasks 1
Example:
.CMMaintenance.ps1 -enabletasks 1

This will open a window to allow you to choose the xml file to import. Choose the XML file that was created in step 1 by opening C:CM-MaintenanceTasks-$date.xml.

The script can be downloaded here:

https://gallery.technet.microsoft.com/scriptcenter/Disable-and-Re-enable-38ae7514

 

Special thanks to Kevin Kasalonis for assisting me with this post.

https://blogs.technet.microsoft.com/cmpfekevin/

 


Viewing all articles
Browse latest Browse all 36188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>