SCOM Remote Maintenance Mode Scheduler 2.0

SCOM Remote Maintenance Mode Scheduler is a GUI based tool that lets administrators easily schedule maintenance mode for a server or group of servers inside System Center Operations Manager 2007.

New Features in version 2.0 include

  • Ability to schedule a daily maintenance mode.
  • New Show Scheduled Tasks Dialog.
  • Added feature to see all details for scheduled jobs.
  • Added feature to delete scheduled jobs
  • Fixed Minor bugs

 

Here is what the new Show Scheduled Tasks Dialog looks like

 

SCOM Remote Maintenance Mode Scheduler 2.0 is now available for download at

http://www.scom2k7.com/downloads/SCOMRemoteScheduler2.0.zip

Updated Instructions available here

SCOM Remote Maintenance Mode Scheduler 2.0 PDF

29 Comments

  1. SCOM Remote Maintenance Mode Scheduler v1.7 | Everything System Center Operations Manager 2007:

    [...]  http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-20/ [...]

  2. Walter Chomak:

    Terrific! I was just doing some work which focuses on this functionlity. I am going to link to your post from my blog, hope you don’t mind!

  3. Stefan Stranger's Weblog - Manage your IT Infrastructure : OpsMgr Remote Maintenance Mode Scheduler:

    [...] Source: Everything System Center Operations Manager 2007 [...]

  4. Marc Cluke:

    It’s getting there, just not as quickly as we want. In our environment, it would be useful to be able to import a .txt, .csv, or .xls file with a list of servers.

  5. admin:

    Marc, create a group with the list of your servers and put the group in Maintenance Mode.

  6. Andrew:

    I am trying this for the first time. Not sure what this error means “The given path’s format is not supported”

    Great potential, though, to help in a big way….

  7. David:

    Hi Tim:

    Thanks for the wonderful tool for the newbie SCOM 2007 admins like me.

    While running the scheduler, I ran into an issue. I tried to run the code directly from the command shell and I get the following error regarding the “null array”. Copy of your script is below the error message.

    Can you tell why I am getting null array?

    Thanks,

    David

    ===============================================================

    C:\>C:\WIN2k3\system32\WindowsPowerShell\v1.0\powershell.exe C:\MaintenanceModeV
    4\AgentMaintenanceModeV4.ps1 -rootMS: `atmspmom04′ -computerPrincipalName: ‘atms
    pasv01′ -minutes:30 -comment: ‘atmspasv01′ -reason: ‘PlannedOther’
    PathName :
    ManagementGroup : SCOM2007DC2
    ManagementServerName : atmspmom04
    Drives :
    You cannot call a method on a null-valued expression.
    At C:\MaintenanceModeV4\AgentMaintenanceModeV4.ps1:13 char:56
    + $healthServices = $computer.GetRelatedMonitoringObjects( <<<< $healthServiceC
    lass)
    Cannot index into a null array.
    At C:\MaintenanceModeV4\AgentMaintenanceModeV4.ps1:14 char:34
    + $healthService = $healthServices[0 <<<< ]
    Putting atmspasv01 into maintenance mode
    New-MaintenanceWindow : Cannot bind argument to parameter ‘MonitoringObject’ be
    cause it is null.
    At C:\MaintenanceModeV4\AgentMaintenanceModeV4.ps1:22 char:81
    + New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObje
    ct:$ <<<< computer -comment:$comment -Reason:$reason
    Putting the associated health service into maintenance mode
    New-MaintenanceWindow : Cannot bind argument to parameter ‘MonitoringObject’ be
    cause it is null.
    At C:\MaintenanceModeV4\AgentMaintenanceModeV4.ps1:26 char:81
    + New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObje
    ct:$ <<<< healthService -comment:$comment -Reason:$reason
    Putting the associated health service watcher into maintenance mode
    New-MaintenanceWindow : Cannot bind argument to parameter ‘MonitoringObject’ be
    cause it is null.
    At C:\MaintenanceModeV4\AgentMaintenanceModeV4.ps1:30 char:81
    + New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObje
    ct:$ <<<< healthServiceWatcher -comment:$comment -Reason:$reason

    =============================================================

    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
    $healthServiceClass = get-monitoringclass -name:Microsoft.SystemCenter.HealthService
    $healthServiceWatcherClass = get-monitoringclass -name:Microsoft.SystemCenter.HealthServiceWatcher
    $computerCriteria = “PrincipalName=’” + $computerPrincipalName + “‘”
    $computer = get-monitoringobject -monitoringclass:$computerClass -criteria:$computerCriteria
    $healthServices = $computer.GetRelatedMonitoringObjects($healthServiceClass)
    $healthService = $healthServices[0]
    $healthServiceCriteria = “HealthServiceName=’” + $computerPrincipalName + “‘”
    $healthServiceWatcher = get-monitoringobject -monitoringclass:$healthServiceWatcherClass -criteria:$healthServiceCriteria
    $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

    “Putting the associated health service into maintenance mode”
    New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObject:$healthService -comment:$comment -Reason:$reason

    “Putting the associated health service watcher into maintenance mode”
    New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObject:$healthServiceWatcher -comment:$comment -Reason:$reason

  8. David:

    Hi Tim:

    I figured out that if I am using the FQDN instead of netbios name, it works.

    However, I have one question. Your program is setting the default location of the powershell program to c:\windows and I need to change that to c:\win2k. What do I change to give correct location of the powershell program?

    Thanks,

    David

  9. FastBitz:

    Terrific Solution!!! Thanks very much.

  10. Roger:

    Does this tool also put the health service and health service watcher into maintenance mode for the specified server?

  11. Alex:

    It doesn’t look like this tool puts the health service and health service watcher into maintenance mode for the specified server. I still receive heartbeat failure notifications when I shedule a server for maintenance mode. Can the health service and health service watcher be added into this utility?

  12. admin:

    Yes it does puts the health service and health service watcher into maintenance mode for the specified server. Are the scripts firing correctly? Did you try to fire the scripts outside of a scheduled task?

  13. Alex:

    Sorry… I took a look at script now. I see that it does include the health service and health service watcher. The reason it wasn’t working is because I was receiving the “Security Warning”, I unblocked the file and all is well. Thanks.

  14. Ross:

    Nice tool but 1 draw back i’ve noticed.
    It creates the scheduled task on the task server to run using the specified credentials but it uses the account you are logged on as to connect to the task server in order to create it - hence doesn’t work.
    In our environment our normal logon accounts don’t have access to servers. We have admin accounts for this.
    We could run the scheduled tasks on our local PCs but for centralisation and managment this is not good. What happens if a patch goes out overnight and my pc gets rebooted? The task might not run.
    Runas doesn’t work easily for this tool either. I have to runas my cmd line as my admin account and then cd to the shortcut and run that - pain in the neck.
    The only alternative i can see is have everyone login to the task server and use the tool from there but again only 2 (or 3) users connecting at once via RDP.

    I’m sure in most environments this works a treat.
    Has anyone else come across this issue? Thanks

  15. Samson:

    The scheduler is a fantastic tool. But in our case it doesn’t work properly.
    It seems that the script started successfully but the target server is not
    set in a maintenance mode. I have tried several times with different accounts
    on different group and on single server the result is the same. I installed
    the scheduler according to your instruction. What is goes wrong. Is there any
    log file to look?

    Thanks,
    Samson

  16. HanZi:

    Hi
    Was attempting to install onto our new test bench to see if it fulfills our Maintainance Mode problem.. However it fails at the first hurdle 1) Tries to load .net 3.5 (even thought we hve it installed) then the scheduler setup failes with “application requires that assembly system.core version 3.5.0.0 be installed in the GAC first.”
    All the best
    Hans

  17. Chris:

    I agree with Ross, any chance the next release will have the run-as option? We have people in our datacenter that do the monthly server patching and I would like to let them use this tool. They have an admin account and a regular account. There admin account as admin access to the RMS but there regular account does not. So for this scheduler tool to work they would have to be logged into their machine with there admin account. Right now i have their regular account as admins on the RMS but this is not ideal for many reasons. A run as option would make this tool PERFECT. otherwise for the rest of us admins it has worked flawless. Thanks

  18. Chris:

    Nevermind about my last post, i got it working. The run-as option does not work with the shortcut that is created during install. If you go to the following directory C:\Documents and Settings\Yourname\Local Settings\Apps\2.0\5EK5NR3C.LTB\LH93A6KO.OGA\scom..tion_bfe6b84180b2a09d_0002.0000_1929c92e134b4a91
    and copy the scom scheduler exe to your desktop and shift\right click the run as option is there and it works. So it is now completely flawless.

  19. admin:

    Chris and Ross you can do a run as if you search for the actual executable or run process explorer to find it. It is stored in your profile. Once you find it you can even create a new shortcut that has the ability to use run as.

    Mine is under

    C:\Users\tmcfadden\AppData\Local\Apps\2.0\71VQGZ58.OLE\K26N56H6.6VB\scom..tion_bfe6b84180b2a09d_0002.0000_7a7212912dc1142f\Scom Scheduler.exe

    XP might be something like

    C:\Documents and Settings\tmcfadden\AppData\Local\Apps\2.0\71VQGZ58.OLE\K26N56H6.6VB\scom..tion_bfe6b84180b2a09d_0002.0000_7a7212912dc1142f\Scom Scheduler.exe

  20. Manjun:

    I am having the same issue as Samson, it did not put the target server in to maint. even I have admin right on task server and target server, I am running the scheduler from my PC that is in the same domain as the servers and the same ID,
    Any one knows why and the solution?
    Thank you in advance,

    Manjun

  21. Ben:

    Hello
    Is it possible to specify a single server to place into maintenance mode with the tool instead of a group?
    Thanks
    Ben

  22. admin:

    Yes just select the computer Tab at the top.

  23. WebLog de Stéphane PAPP [MSFT] : Planifier la maintenance dans Operations Manager 2007:

    [...] pour planifier des plages de maintenance sur des groupes de serveurs de manière industrielle : http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-20/ Posted: Wednesday, November 26, 2008 8:01 AM by spapp Filed under: Information, Operations [...]

  24. Chuck:

    This tool is a step in the right direction but it and scom itself have some serious limitations.
    Why doesn’t scom have this built in? Why can’t I just put just one monitor into maintenance mode? I have servers that have services that go down for backup nightly. I am using windows watchers for the non-windows services for example. I would like the watcher group task to go into mm but the whole ‘watcher’ server has to go into mm. This is enterprise monitoring 101. Just because one service is down doesn’t mean I don’t care what else happens on the box. What if the backup service failed during the mm window? How would I know that if the whole server is in mm?
    Sorry, this is a real sore point for me.

  25. Walter Chomak's System Center Operations Manager 2007 Landing Zone : Remote Maintenance Mode Scheduler v1.7:

    [...] Courtesy of Everything System Center Operations Manager 2007 - http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-20/ [...]

  26. MichaelW:

    Hi,

    Setting maintenance mode for a group has given mixed results, it isn’t working for the domain controllers groups. To troubleshoot I’ve copied the cmd directly from scheduled tasks and run directly within powershell. The following is returned:

    0 computers found in the ‘XXX-XXX-XXXXXX XXXXX XXXXX’ group

    There are definitely group members, ie View Group Members works within the console; with dynamic group memberships.

    Setting maintenance mode on computers and other groups appears to be working fine. The spaces in the group name hasn’t been a problem for other groups, only the Domain Controllers group. An option would be just to create separate tasks for each DC.

    Any ideas? Thanks..

  27. Tom:

    Can this be used for SNMP devices, ie if i select a computer but enter the device name or is it ony specific to server objects?

  28. admin:

    No it cannot be used for SNMP devices right now. If you look at http://www.scom2k7.com/schedule-a-into-url-maintenance-mode/ it should be pretty easy change the powershell script to Get-Monitoring class for SNMP devices.

    So change

    $URLWatcher = (Get-MonitoringClass -name whatever the correct SNMP class is) | Get-MonitoringObject | where {$_.DisplayName -eq $urlName}

  29. Tom:

    so when running the command, where it says -urlName can i substitute the group name that contains SNMP devices?

Leave a comment