So what is in maintenance mode?
In MOM 2005 you could put computers into maintenance mode; in OpsMgr 2007 maintenance mode is much more granular. Instead of putting the whole computer into maintenance mode, you can put a particular database or NT service into maintenance mode. At times it can be challenging to figure out what do you actually have in maintenance mode, when did the maintenance mode start and when will it finish, and finally why a particular component is in maintenance mode. Here is a script that I put together that should simplify understanding what is actually in maintenance mode.
$criteria = new-object Microsoft.EnterpriseManagement.Monitoring.MonitoringObjectGenericCriteria("InMaintenanceMode=1")
$objectsInMM = (Get-ManagementGroupConnection).ManagementGroup.GetPartialMonitoringObjects($criteria)
$objectsInMM | select-object DisplayName, @{name="Object Type";expression={foreach-object {$_.GetLeastDerivedNonAbstractMonitoringClass().DisplayName}}},@{name="Start Time";expression={foreach-object {$_.GetMaintenanceWindow().StartTime.ToLocalTime()}}},@{name="End Time";expression={foreach-object {$_.GetMaintenanceWindow().ScheduledEndTime.ToLocalTime()}}},@{name="Path";expression={foreach-object {$_.Path}}},@{name="User";expression={foreach-object {$_.GetMaintenanceWindow().User}}},@{name="Reason";expression={foreach-object {$_.GetMaintenanceWindow().Reason}}},@{name="Comment";expression={foreach-object {$_.GetMaintenanceWindow().Comment}}}
Basically this script does the following:
1 - Creates a criteria object to specify that we want only the objects that are in maintenance mode
2 - Issues a query to the SDK service with the specified criteria
3 - The rest is formatting the data into a table
Comments
- Anonymous
August 07, 2007
PingBack from http://goteamshake.com/?p=26 - Anonymous
February 29, 2008
There are many articles that talk about maintenance mode in System Center Operations Manager 2007. Topics - Anonymous
April 05, 2008
small correction for script above.To get the Comment to show, change this:$.GetMaintenanceWindow().Commentto this:$.GetMaintenanceWindow().Comments - Anonymous
July 12, 2008
Check out Boris Yanushpolsky's blog ( http://blogs.msdn.com/boris_yanushpolsky ). Boris is an SCOM - Anonymous
December 02, 2008
The comment has been removed - Anonymous
January 06, 2009
umair_muqeem@hotmail.com92-300-3056678