SCOM Maintenance Mode

(imported topic written by SystemAdmin)

This is probably going to be extremely difficult if not imposable.

Via a script, either C# or Power Shell (and probably others), you can place a server that is using SCOM 2007 into Maintenance Mode. With that said, you can run this script from with in BigFix prior to installing patches and rebooting the host.

Scenario:

Each month, we install Windows patches and reboot the servers. Prior to the patches being deployed, we would like to set the hosts into Maintenance mode for a period of time (15 minutes for example).

What makes this difficult, is that our servers are in 2 hour Patch Buckets (using Automatic Groups) through out a weekend. How would this script be able to parse the list of hosts and put each in Maintenance mode prior to performing the patch installs.

Has anyone done something like this in their envronment?

-Ken

(imported comment written by BenKus)

Hi Ken,

Actually, this seems pretty straightforward… Try this:

  1. Create a script to put the computer into maintenance mode and wait 15 minutes.

  2. Create a BigFix Task in BigFix that deploys this script.

  3. When you deploy a Baseline, add this Task to the first element of the baseline (OR if you are using multiple action groups and not baselines, you can use the “Pre-Action Script”)

Once you have this, your next question is around maintenance times to deploy this new baseline… You can search around the forum and see here:

http://forum.bigfix.com/viewtopic.php?id=1241

Ben

(imported comment written by SystemAdmin)

Thanks, Ben.

I think the hardest part is going to be Step 1. For example, if I schedule a Baseline to be deployed to 60 relevant hosts, the SCOM script will need to process each host name that happens to be relevant at the time of the deployment.

Like you said, I’m going to have to start by attempting to create a Task that can be deployed to many hosts and at the same time, determine the individual host name. If the task can pull a retrieved property from the individual systems (in this case the host name), then it may be possible.

-Ken

(imported comment written by BenKus)

Hi Ken,

I am not sure if I understand… If you are asking to substitute the hostname inside the action, then that is pretty easy…

My assumption above was that each computer could run a script to put itself into Maintenance Mode… Was that an incorrect assumption?

Ben

(imported comment written by SystemAdmin)

I think I see what you are saying. The Task will kick of the script on each computer; therefore the hostname (in regards to the script being ran) will be irrelevant. Oppose to the BES running the script on behalf of the host. Let me think about this a bit more.

Thanks.