Maintenance Mode history

Hi,

I'm trying to figure out what was the time when server was put into MM. Have a concern as MM history (when i run sql query) shows diff time other than when the server was put into MM actually. What could be the reason?

Thanks,

Varun 


January 24th, 2013 1:18pm

Hi Varun

What version of SCOM are you using? It shouldn't affect the results but will affect the PShell script below.

Is it a timezone difference?

Which timezone are you in compared to UTC time? Is this the difference you are seeing?

Is it Kevins SQL query you are running?

http://blogs.technet.com/b/kevinholman/archive/2009/06/05/maintenance-mode-tying-the-text-of-the-category-to-the-database.aspx

Or from here - http://blogs.technet.com/b/brianwren/archive/2008/03/11/mms-command-shell-presentation.aspx

View maintenance mode history for an object:

> $mc = get-monitoringClass -name Microsoft.Windows.Computer
> $mo = get-monitoringObject -monitoringClass $mc | where {$_.name -eq 'srv01'}
> $mo | get-maintenanceWindow -history

Cheers

Graham

Free Windows Admin Tool Kit Click here and download it now
January 24th, 2013 1:25pm

Hi Graham,

We are using SP1... and both SCOM and server in concern (exchange cluster) are in same time zone. Team use SCOM Remote Maintenance Mode Scheduler 2.0 to put server into MM

I'm running below query..

USE OperationsManagerDW
SELECT ManagedEntity.DisplayName, MaintenanceModeHistory.*
FROM ManagedEntity WITH (NOLOCK) 
INNER JOIN
MaintenanceMode ON ManagedEntity.ManagedEntityRowId = MaintenanceMode.ManagedEntityRowId 
INNER JOIN
MaintenanceModeHistory ON MaintenanceMode.MaintenanceModeRowId = MaintenanceModeHistory.MaintenanceModeRowId
where DisplayName Like '%servername%'

Thanks,

Varun 

January 24th, 2013 1:38pm

just to confirm SCOM 2007 SP1....
Free Windows Admin Tool Kit Click here and download it now
January 24th, 2013 1:42pm

SP1 ?? It really is time to upgrade ;-) Well, probably reinstall as upgrading from SCOM 2007 SP 1 to SCOM 2012 SP1 would take 3 steps through the other versions!

Back to the matter at hand. What is the difference in time between the result given by the SQL Query and the result you expect?

Is it 3 hours \ 4 hours etc ... or are we just talking about a few minutes? 

I think that is the Tim Mcfadden tool and from memory all that does is create a PShell script that (I think) you execute through Task Scheduler. 

Cheers

Graham

January 24th, 2013 1:47pm

Diff is of 3 to 4 hrs....

even i've checked it on R2 as well (test env) and in this case as well no where near to when i put server into MM...

Thanks,

Varun 

Free Windows Admin Tool Kit Click here and download it now
January 24th, 2013 1:58pm

OK .. but where are you located? 

What time is it now for you?

E.g. is it 17:00 or 11:00?

Cheers

Graham

January 24th, 2013 2:02pm

SCOM 2007 SP1 is in (GMT-05:00) Eastern Time (US & Canada).. including server in concern and its 9:10 am

i am in (UTC+05:30)  zone and my lab server also in this time zone only... and its 19:40 here :) 

Thanks,

Varun

Free Windows Admin Tool Kit Click here and download it now
January 24th, 2013 2:12pm

How are you actually putting the server into maintenance mode? Is it through Task Scheduler?

The DW stores data in UTC time so that will explain part of the difference ... have you checked in Windows Task Scheduler to see what time the script is actually executing?

Cheers

Graham

January 24th, 2013 2:32pm

Was just on another project and came across this from my notes - wondered if this might also help:

http://blogs.technet.com/b/kevinholman/archive/2009/06/11/outages-and-maintenance-report.aspx?PageIndex=2#comments

Cheers

Graham

Free Windows Admin Tool Kit Click here and download it now
January 29th, 2013 3:17pm

FYI - i used the PS commands from Graham but reworked for SCOM 2012 compatibility:

> $mc = Get-SCOMMonitoringObject -Name Microsoft.Windows.Computer
> $mc = get-SCOMClass -name Microsoft.Windows.Computer
> $mo = Get-SCOMMonitoringObject -Class $mc | where {$_.name -like 'Server1*'}
> $mo | Get-SCOMMaintenanceMode -History

April 25th, 2014 3:30pm

FYI - i used the PS commands from Graham but reworked for SCOM 2012 compatibility:

> $mc = Get-SCOMMonitoringObject -Name Microsoft.Windows.Computer
> $mc = get-SCOMClass -name Microsoft.Windows.Computer
> $mo = Get-SCOMMonitoringObject -Class $mc | where {$_.name -like 'Server1*'}
> $mo | Get-SCOMMaintenanceMode -History


That works great. But I would also like to see the description/comments that the user added. How ccan I see that?
Free Windows Admin Tool Kit Click here and download it now
October 3rd, 2014 8:01am

Hey Graham,

Could you please share some details on how exactly maintenance mode happens through task scheduler ? 

June 4th, 2015 6:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics