I just got done with my previous post on setting maintenance mode for a group of objects, and I happened to check Boris Yanushpolsky’s blog. Bori’s blog is an outstanding reference for various Command Shell scripts, and I have to give him credit for helping me come up to speed on several concepts. Turns out just tonight put up a script for….yep, you guessed it….setting maintenance mode on a group of objects.
As it turns out, I spent more time getting the script to run in a management pack, using overrides, etc. The script that Boris did is more complex than the one I did by putting computers into maintenance mode along with their health service. If that one fits your requirements better, than it should take all that much effort to move it into my sample management pack. Just a matter of pasting the script code into my write action and swapping around some script arguments.