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
Technology Tips and News
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
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?
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
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 OperationsManagerDWThanks,
Varun
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
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
OK .. but where are you located?
What time is it now for you?
E.g. is it 17:00 or 11:00?
Cheers
Graham
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
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
Was just on another project and came across this from my notes - wondered if this might also help:
Cheers
Graham
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
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
Hey Graham,
Could you please share some details on how exactly maintenance mode happens through task scheduler ?