Can't put random servers in Maintenance Mode - SCOM 2022

de Fraine, Sean 60 Reputation points
2025-10-01T08:59:52.93+00:00

Hi everyone,

Recently I've been getting an error trying to manually put random servers in to Maintenance Mode. We have an estate of 250+ servers being monitored. Monitoring is fine, they behave as expected yet when I try and put a hand full in to Maintenance Mode we get the following error:

The client has been disconnected from the server.  Please call ManagementGroup.Reconnect() to reestablish the collection.

Date: 01/10/2025 09:52:44

Application: Operations Manager

Application Version: 10.22.10928.0

Severity: Warning

Message:

 

Microsoft.EnterpriseManagement.Common.ServerDisconnectedException: The client has been disconnected from the server. Please call ManagementGroup.Reconnect() to reestablish the connection. ---> System.InvalidOperationException: The monitoring object is already in maintenance mode.

   --- End of inner exception stack trace ---

   at Microsoft.EnterpriseManagement.Common.Internal.ExceptionHandlers.HandleChannelExceptions(Exception ex)

   at Microsoft.EnterpriseManagement.Common.Internal.ServiceProxy.HandleFault(String methodName, Message message)

   at Microsoft.EnterpriseManagement.Common.Internal.AdministrationServiceProxy.StartMaintenanceMode(Guid managedEntityId, DateTime startTime, DateTime scheduleEndTime, Int32 reason, String comments, Boolean recursive)

   at Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObject.ScheduleMaintenanceMode(DateTime startTime, DateTime scheduledEndTime, MaintenanceModeReason reason, String comments, TraversalDepth traversalDepth)

   at Microsoft.EnterpriseManagement.Mom.UI.MaintenanceModeDialog.<OkButtonClick>b__12_0(Object <p0>, ConsoleJobEventArgs <p1>)

   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)

System.InvalidOperationException: The monitoring object is already in maintenance mode.

The servers are not in Maintenance Mode, I have confirmed this with PowerShell. I have rebooted OMS and DB servers. I can't find anything online to re-establish the connection. Any help appreciated. I have a DV environment which can Maint Mode the servers in question fine, so it is SCOM rather than the server client.

Thanks in advance,

Sean

System Center Operations Manager
System Center Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
0 comments No comments
{count} votes

Answer accepted by question author
  1. SChalakov 10,666 Reputation points MVP Volunteer Moderator
    2025-12-10T14:12:45.57+00:00

     

    Hi Sean,

    the key part of the stack trace is the inner exception:

    System.InvalidOperationException: The monitoring object is already in maintenance mode.

    The “client has been disconnected, please call ManagementGroup.Reconnect()” text is just what the console shows when the SDK call fails, but the real reason is that OpsMgr believes the target object is already in maintenance mode.

    Because maintenance mode in SCOM is per object, not per “server”, it is very easy to have a situation where a related object is in MM while the Windows Computer view looks normal. I would go through these steps:

     

    1. Check MM status for all related objects

    Pick one of the affected servers and, in the SCOM 2022 management group where you see the issue, run something like:

    Import-Module OperationsManager
    $serverName = "SRV01"   # replace with one of your problem servers
     
    $classNames = @(
        "Microsoft.Windows.Computer",
        "Microsoft.SystemCenter.HealthService",
        "Microsoft.SystemCenter.HealthServiceWatcher"
    )
     
    foreach ($className in $classNames) {
        $class = Get-SCOMClass -Name $className
        $instances = Get-SCOMClassInstance -Class $class | Where-Object {
            $_.DisplayName -eq $serverName -or $_.Path -like "*$serverName*"
        }
     
        foreach ($inst in $instances) {
            "`n== $($className) : $($inst.DisplayName) =="
            Get-SCOMMaintenanceMode -Instance $inst |
                Select-Object DisplayName, StartTime, ScheduledEndTime, Reason, Comment |
                Format-Table -AutoSize
        }
    }
     
    Get-SCOMMaintenanceMode | Where-Object { $_.DisplayName -match $serverName } |
        Select-Object DisplayName, StartTime, ScheduledEndTime, Reason, Comment |
        Format-Table -AutoSize
    

    This shows whether any of the related objects (computer, HealthService, watcher, etc.) are actually in MM for that machine, even if the standard “Windows Computers” view suggests otherwise.

    If you find any entries, end them:

    Get-SCOMMaintenanceMode | Where-Object { $_.DisplayName -match $serverName } |
        Set-SCOMMaintenanceMode -EndTime (Get-Date) -Comment "Cleanup for $serverName"
    
    

    2. Check for scheduled maintenance that targets these servers

    See if there is any active maintenance schedule still targeting those machines:

    Get-SCOMMaintenanceSchedule | Where-Object {
        $_.Targets -match $serverName
    } | Select-Object Name, Enabled, IsActive, NextRuntime, Targets | Format-List
    
    

    If you find any suspicious/stuck schedules, you can stop them with:

    Get-SCOMMaintenanceSchedule | Where-Object {
        $_.Targets -match $serverName
    } | Stop-SCOMMaintenanceSchedule
    
    

    Misconfigured schedules are a common source of “object is already in maintenance mode” behaviour.

     

    3. Test maintenance mode from PowerShell

    Next, bypass the console and try starting maintenance mode via PowerShell:

    $instance = Get-SCOMClassInstance -DisplayName $serverName
    Start-SCOMMaintenanceMode -Instance $instance `
        -Reason PlannedOther `
        -Comment "Test MM from PowerShell" `
        -Duration (New-TimeSpan -Minutes 30)
    

     

    • If you get the same error here, you know the issue is purely on the server/DB side (schedules, stale MM entries, or automation).
    • If PowerShell works but the console still throws the error, then it is more of a console or SDK channel problem.

    In that case:

    1. Make sure your console user is in the Operations Manager Administrators role.
    2. Clear the local console cache (%LOCALAPPDATA%\Microsoft\System Center\Operations Manager\Console) and reopen the console.
    3. Check the Operations Manager event log on the management server for any errors at the time you click OK in the Maintenance Mode dialog.

     

    4. Check for custom maintenance mode automation

    Finally, check whether production has any custom or third-party maintenance mode solution that dev does not – for example:

    • SCCM integration that triggers SCOM maint mode,
    • SCOMAgentHelper / agent-side MM modules,
    • Cookdown / gateway-based maintenance packs, etc.

    Those can put a subset of servers into MM under specific classes or with long durations, which would explain why dev can maint-mode them cleanly, but prod believes the objects are already in maintenance.

    If you run through those steps for one of the affected servers you should be able to see where SCOM thinks maintenance mode is already active and either clean up the existing entries or fix the schedule/automation that is setting them.

     

     

    Best Regards

    Stoyan Chalakov

    "If my response was useful, please consider marking it as the answer. It keeps the forum clean, structured, and more helpful for everyone. Thank you for supporting the community."

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.