Looking for a good way to automate putting machines in maintenance mode while patching, firmware upgrades, software maintenance is being performed. The list can be quite large and changes from month to month. We typically on the SCCM side get a list of machines and a window every month when we can perform maintenance we use right click tools to add that list to a collection and then perform our patching and after that hardware team is free to do any firmware updates and then app owners any application work so just using the check boxes in SCCM is not practical. Having maybe hundreds of servers going at once makes having individuals put them in maintenance mode is Squared Up is impractical. My last job I did a runbook in scorch but I do not currently have SCORCH here. Looking for ideas and thoughts
If your SCCM team uses SCCM right click tools, I have a GUI I made with PowerShell studio you can adapt. Basically we compile the script into an exec and the SCCM team sends parameters to it from an SCCM collection via the right click tools.
It has a few other features like create/remote VMware snapshots, etc. Of course, the code comes with no support or warranty (use at your own risk).
I read something about it, but did not try it yet:
SCCM Service Window to SCOM Maintenance Mode Automation
This management pack was designed with two parts. These parts, contained in a single Rule and one Data Source Method, were broken up to provide System Center Operations Manager with the ability of automatically placing a system into Maintenance Mode using System Center Configuration Manager Service Windows.
These two parts enable the ability to automatically trigger the Operations Manager Maintenance Mode function based upon the Configuration Manager Service Windows found in the Configuration Manager Agent’s WMI stack. The scheduled “SCOM Agent Initiated Maintenance Mode Rule for Active SCCM Service Windows” rule, accounts for Service Window overlap, calculates the total service window duration and sends property bag items from the Operations Manager Agent directly to the Management Server that the agent is connected to.
Please share your experience 🙂
I’m pretty sure we have a script which reads the MW config from SCCM and creates maintenance schedules in SCOM which match them.
I’ll see if I can track down the script tomorrow.
We actually have three different scripts that we use to achieve this goal, but this is partly because of how our Mainenance Windows are targetted in SCCM.
In our case we use AD Groups to control which MW a Server falls under. These groups are then used within SCCM to ensure that the appropriate schedule is adhered to. For us the goal we to make sure that we applied the same maintenance schedule in SCOM to make sure we avoided false positives whilst patching was taking place.
The scripts therefore do the following:
Script 1: Retrieve Data From SCCM – Export lists of maintenance windows and collection member from the SCCM database, and store them as CSV files.
Script 2: Populate Groups – Import collection members from a CSV, then create or update matching Groups in SCOM.
Script 3: Configure Maintenance Schedules – Import maintenance windows from a CSV, then create SCOM Maintenance Schedules for any windows in the future,
The scripts we’re using might not be a good fit if you’re working in a different way in SCCM. But, perhaps components of them could be used as the basis for something which would work for you.
You can schedule Maintenance mode in SCOM 2016+ – anyone made good use of this with patching windows?