SCOM: Maintenence mode investigation query

An oldie but a goodie, the below SQL script will help with investigating if a server was placed into maintenance mode and if so by whom. Just change %computer:% to the name of the specific device you are investigating and the StartDateTime as required.

USE OperationsManagerDW
go
SELECT DISTINCT
MngE.DisplayName AS ServerName, MM.StartDateTime, MM.EndDateTime, MM.PlannedMaintenanceInd AS [PlannedMaintenance_1Yes-0No],
MM.DWLastModifiedDateTime, MMH.Comment, MMH.UserId
FROM OperationsManagerDW.dbo.vMaintenanceMode AS MM INNER JOIN
OperationsManagerDW.dbo.vMaintenanceModeHistory AS MMH ON MMH.MaintenanceModeRowId = MM.MaintenanceModeRowId INNER JOIN
OperationsManagerDW.dbo.vManagedEntity AS MngE ON MngE.ManagedEntityRowId = MM.ManagedEntityRowId
WHERE     
MngE.FullName LIKE ‘%computer:%’ AND (MM.StartDateTime > ‘2014-03-01’)
ORDER BY MM.DWLastModifiedDateTime

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.