One more maintenance mode script
Attached is a script that takes a group and puts all the computers in the group (as well as the health service and the healthservice watcher) into maintenance mode.
Here is how you can run the script from the command line to start or stop maintenance mode (without launching powershell.exe)
One of the uses of this script is when you deploy hotfixes to a large number of servers. You can also very easily use Task Scheduler to run this script on a regular basis for your maintenance windows.
Starting MM - powershell "c:\GroupMM.ps1" -groupName:'All Computers' -hours:10 -rmsServerName:'localhost' -startMM:$true
Ending MM - powershell "c:\GroupMM.ps1" -groupName:'All Computers' -hours:10 -rmsServerName:'localhost' -startMM:$false
Comments
- Anonymous
March 04, 2008
PingBack from http://aceddl.cn/x/opsmgr2007-scheduling-groups-of-objects-for-maintenance-mode.jsp - Anonymous
March 25, 2008
The comment has been removed - Anonymous
March 27, 2008
Excellent script Boris - just a quick question, does the group need to be based on the Windows Server object, or can it be any subset? For example, a dynamic list based on Logical disks? - Anonymous
March 28, 2008
I dont think you can exclude a group from another group's definition. What you can do is create another class and create a discovery for this class (instances of this class would be the onces that need to go in MM at the same time). Then include only this class in the group. - Anonymous
March 31, 2008
"Then include only this class in the group."Ultimately, this would fail me as inevitably server instances will be a part of more than one class that I define for maintenanec mode. - Anonymous
July 12, 2008
Check out Boris Yanushpolsky's blog ( http://blogs.msdn.com/boris_yanushpolsky ). Boris is an SCOM - Anonymous
October 02, 2008
Main Downloads page (catalog, documentation) http://technet.microsoft.com/en-us/opsmgr/bb498232.aspx - Anonymous
February 26, 2009
  Voici une liste de liens trés pratique sur tous les sujets SCOM , installation , configuration... - Anonymous
May 13, 2009
Our servicedesk is using an adapted version of the GroupMaintenancemode -script from Boris Yanushpolski