Automatic servers in Maintenance mode
Hi I got a new requirement from Management team In one of our project the servers rebooting daily at 04:00 AM. I want put automatically the servers in maintenance mode form 03:55 AM PST to 04:15 AM PST. Anyone knows how to do this in SCOM automatically without maual intervention. Regards Donald D'souza
February 1st, 2010 7:03am

HiDid you tried this http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-20/ ?http://OpsMgr.ru/
Free Windows Admin Tool Kit Click here and download it now
February 1st, 2010 7:29am

Hi Alexey, my name is Ziba. I have the same thread for scheduling SCOM managed servers maintenance mode. I have downloaded the tool and followed step-by-step instruction on 64 bit and 32 bit and haven't been able to run the setup.exe. Have you tried it? If so, would you let me know if there is a trick to get it installed? I appreciate your help very much (I am still waiting to receive response on my thread). Thanks, Ziba
February 1st, 2010 9:09am

Just note that the scripts that this utility uses haven't been updated for Operations Manager 2007 R2. In OpsMgr 2007 R2, the health service is automatically put into maintenance mode with the computer object so you can remove references to the health service and health service watchers from the scripts in the MaintenanceModeV4 folder.For instance, the AgentMaintenanceModeV4 powershell script should be: param($rootMS,$computerPrincipalName,$minutes,$comment,$reason) Add-PSSnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable errSnapin; Set-Location "OperationsManagerMonitoring::" -ErrorVariable errSnapin; new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin; set-location $rootMS -ErrorVariable errSnapin; $computerClass = get-monitoringclass -name:Microsoft.Windows.Computer $computerCriteria = "PrincipalName='" + $computerPrincipalName + "'" $computer = get-monitoringobject -monitoringclass:$computerClass -criteria:$computerCriteria $startTime = [System.DateTime]::Now $endTime = $startTime.AddMinutes($minutes) "Putting " + $computerPrincipalName + " into maintenance mode" New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObject:$computer -comment:$comment -Reason:$reason CheersGrahamView OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
February 1st, 2010 12:38pm

Hi Graham This script will work in SP1 correct? Regards Donald D'souza
February 1st, 2010 4:47pm

If you are using SP1 then the original download from Alex will work without any adjustments.CheersGrahamView OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
February 1st, 2010 6:37pm

Hi Ziba,I got it working without any issues. As Graham said, it requires some adjustments to work in R2 environment. Besides that, MMScheduler works fine.http://OpsMgr.ru/
February 2nd, 2010 12:08am

Hi Graham, after your adjustment i got this error in power shell: Putting server.domain.com into maintenance mode New-MaintenanceWindow : Cannot bind argument to parameter 'Comment' because it is an empty string. At C:\MaintenanceModeV4\AgentMaintenanceModeV4.ps1:16 char:100 + New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObject:$computer -comment:$ <<<< comment -Reason:$reason I'm running W2k3 SP2 with SCOM 2007 R2 Thank for any help
Free Windows Admin Tool Kit Click here and download it now
April 14th, 2010 1:37pm

Hi,I added one more line: $comment='any_text' to this script and everything is working well. Thank for this post guysparam($rootMS,$computerPrincipalName,$minutes,$comment,$reason) Add-PSSnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable errSnapin; Set-Location "OperationsManagerMonitoring::" -ErrorVariable errSnapin; new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin; set-location $rootMS -ErrorVariable errSnapin; $computerClass = get-monitoringclass -name:Microsoft.Windows.Computer $computerCriteria = "PrincipalName='" + $computerPrincipalName + "'" $computer = get-monitoringobject -monitoringclass:$computerClass -criteria:$computerCriteria $startTime = [System.DateTime]::Now $endTime = $startTime.AddMinutes($minutes) $comment='any_text' "Putting " + $computerPrincipalName + " into maintenance mode" New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObject:$computer -comment:$comment -Reason:$reason
April 15th, 2010 5:07am

have someone this file for unix/Linux computers? I need maintenance mode for them
Free Windows Admin Tool Kit Click here and download it now
October 9th, 2012 7:03am

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

Other recent topics Other recent topics