Menu Close

Enabling Scheduled Maintenance in SCOM 2016

When you try and use the new Scheduled Maintenance feature in SCOM 2016 UR1, you will probably see the following error pop up as soon as you select “Maintenance Schedules” in the Operations Console:

 

image

 

Date: 10/22/2016 3:03:32 PM
Application: Operations Manager
Application Version: 7.2.11719.0
Severity: Error
Message:

The EXECUTE permission was denied on the object ‘sp_help_jobactivity’, database ‘msdb’, schema ‘dbo’.
The data access service account might not have the required permissions

If you move forward and try to create a maintenance schedule – you will see something like this:

 

image

 

Note: The following information was gathered when the operation was attempted. The information may appear cryptic but provides context for the error. The application will continue to run. Microsoft.EnterpriseManagement.Common.ServerDisconnectedException: The client has been disconnected from the server. Please call ManagementGroup.Reconnect() to reestablish the connection. ---> System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. Server stack trace: at System.ServiceModel.Channels.CommunicationObject.ThrowIfFaulted() at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.EnterpriseManagement.Common.Internal.IDispatcherService.DispatchUnknownMessage(Message message) at Microsoft.EnterpriseManagement.Common.Internal.AdministrationServiceProxy.CreateMaintenanceSchedule(String scheduleName, Boolean recursive, Boolean isEnabled, Boolean isRecurrence, Boolean isEndTimeSpecified, Int32 duration, Int32 reason, String comments, String managedEntityIdList, Int32 freqType, Int32 freqInterval, Int32 freqSubdayType, Int32 freqSubdayInterval, Int32 freqRelativeInterval, Int32 freqRecurrenceFactor, DateTime activeStartTime, DateTime activeEndDate) --- End of inner exception stack trace --- at Microsoft.EnterpriseManagement.Common.Internal.ExceptionHandlers.HandleChannelExceptions(Exception ex) at Microsoft.EnterpriseManagement.Common.Internal.AdministrationServiceProxy.CreateMaintenanceSchedule(String scheduleName, Boolean recursive, Boolean isEnabled, Boolean isRecurrence, Boolean isEndTimeSpecified, Int32 duration, Int32 reason, String comments, String managedEntityIdList, Int32 freqType, Int32 freqInterval, Int32 freqSubdayType, Int32 freqSubdayInterval, Int32 freqRelativeInterval, Int32 freqRecurrenceFactor, DateTime activeStartTime, DateTime activeEndDate) at Microsoft.EnterpriseManagement.Monitoring.MaintenanceSchedule.MaintenanceSchedule.CreateMaintenanceSchedule(MaintenanceSchedule maintenanceSchedule, ManagementGroup mg) at Microsoft.EnterpriseManagement.Mom.Internal.UI.Administration.MaintenanceModeSchedule.Pages.MaintenanceModeScheduleDetailsPage.<OnSave>b__0(Object param0, ConsoleJobEventArgs param1) at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args) System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. Server stack trace: at System.ServiceModel.Channels.CommunicationObject.ThrowIfFaulted() at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.EnterpriseManagement.Common.Internal.IDispatcherService.DispatchUnknownMessage(Message message) at Microsoft.EnterpriseManagement.Common.Internal.AdministrationServiceProxy.CreateMaintenanceSchedule(String scheduleName, Boolean recursive, Boolean isEnabled, Boolean isRecurrence, Boolean isEndTimeSpecified, Int32 duration, Int32 reason, String comments, String managedEntityIdList, Int32 freqType, Int32 freqInterval, Int32 freqSubdayType, Int32 freqSubdayInterval, Int32 freqRelativeInterval, Int32 freqRecurrenceFactor, DateTime activeStartTime, DateTime activeEndDate)

 

 

This is caused by the SCOM Data Access account needing some additional permissions in SQL in order to control maintenance schedules via SQL Agent.  You will need to configure this just once to get it going.

 

In SQL Management studio – expand Security, Logins, and find the account you used for the SDK/DAS account.

Right-click the account and choose Properties.

Select User Mapping, and check the box next to the MSDB database.

Grant the following rights for the SDK/DAS account to the MSDB database:

  • SQLAgentOperatorRole
  • SQLAgentReaderRole
  • SQLAgentUserRole

image

 

Once you apply this one-time change, the Maintenance Schedules works perfectly

17 Comments

  1. Abdulla Alaali

    The EXECUTE permission was denied on the object ‘sp_help_jobactivity’, database ‘msdb’, schema ‘dbo’.
    The data access service account might not have the required permissions

    mentioned premiums does not help me solving my issue .Could you help please

  2. Gergő Kurfis

    Hi Kevin! We encountered a strange error, when tried to add a new MaintenanceMode Schedule.
    If we ran it with FreqType 4 and with any FreqInterval, the creation was success (Ex:New-SCOMMaintenanceSchedule -NAme “No Power – $mo.DisplayName” -Recursive -Enabled -MonitoringObjects $mo.Id -ActiveStartTime ’00:00:00′ -Duration 120 -ReasonCode PlannedOther -Comments “No Power” -FreqType 4 -FreqInterval 32).
    If we wanted to add it with FreqType 8 and with any valid FreqInterval (Ex: PS E:\> New-SCOMMaintenanceSchedule -NAme “No Power – $mo.DisplayName” -Recursive -Enabled -MonitoringObjects $mo.Id -ActiveStartTime ’00:00:00′ -Duration 120 -ReasonCode PlannedOther -Comments “No Power” -FreqType 8 -FreqInterval 46), we got the same error message: “New-SCOMMaintenanceSchedule : The client has been disconnected from the server. Please call ManagementGroup.Reconnect() to reestablish the connection.”
    Have you encountered an issue like this?
    Thank you in advance,
    Gergő

  3. Shiva ravichandran

    HI Kevin,

    How to give access to set a Scheduled maintenance mode to a non-admin user?

    Help me o this please…

  4. Stephen

    These schedules appear limited to only the user that created them or SCOM Admins. Any workaround to where the same schedule would be available to a team?

  5. Adam Hulek

    Hello Kevin,

    It seems that In SCOM 2019 the MM schedules are no longer stored in msdb.dbo.sysjobs.
    Is there any article that explains how the MM schedules are executed in the new version of SCOM?

  6. StephenM

    This is the table that contains the schedules. [OperationsManager].[dbo].[MaintenanceModeSchedule].

    In SCOM there is a rule called ‘Maintenance Mode’ that triggers a stored procedure every 300 seconds (5 minutes) ‘p_ScheduledJobsEveryFiveMinutes’ which contains additional stored procedures.

  7. Steve

    Is this still relevant for SCOM 2022 UR2? We are seeing the “The client has disconnected from the server…” error at the end of trying to create a scheduled maintenance item, but not the “The EXECUTE permission…” error.

    I haven’t tried this fix as yet as I was hoping to figure out if it was still the same issue as described here. This is on a new 2022 install patched to UR2.

    Thanks

    • Steve

      Turns out this is still relevant for 2022 UR2. After having a ticket open with Microsoft for a month and a half they finally pointed back to this article being the fix.

  8. Steve

    We’re experiencing an issue with Maintenance Mode Schedules where they basically only fire once. If I

    select * from [OperationsManager].[dbo].[MaintenanceModeSchedule]

    it seems that the NextRunTime value isnt being incremented on the conclusion of the maintenance schedule – a 30 minute daily recurring maintenance schedule I configured as a test this morning for 9am has a NextRunTime of 2024-11-13 09:00:00.000 for example.

    Any suggestions as to why this might be the case and what to do about it greatly appreciated!

    • Steve

      I don’t know if I’m going off down a rabbit hole with this, but digging into the stored procedures a bit, p_MaintenanceScheduleUpdateNextRunTime has never executed. Should I have a SQL agent job that fires this sproc?

      • steve

        I suspect I’m treating a symptom rather than the problem, but anyway for the moment I’ve created an agent job that fires that sproc for each schedule ID once a day. It cant be right, but it seems to be an ok workaround.

Leave a Reply

Your email address will not be published.