The Edit-SCOMMaintenanceSchedule cmdlet edits an existing maintenance schedule.
However, you cannot edit a schedule that is currently active.
When a resource is in maintenance mode, Operations Manager suppresses alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts.
A maintenance schedule can be used to schedule a set of resources to go into maintenance mode.
You can use this cmdlet to edit schedules to run once, daily, weekly or monthly on a particular day or a day of the week.
You must pass the ScheduleId of an existing schedule that you want to edit.
All other parameters are optional; the specified parameters are overwritten.
By default, this cmdlet uses the active persistent connection to a management group.
Use the SCSession parameter to specify a different persistent connection.
You can create a temporary connection to a management group by using the ComputerName and Credential parameters.
For more information, type Get-Help about_OpsMgr_Connections.
Examples
1: Edit a System Center Operations Manager maintenance mode scheduled using ID
Edits the Maintenance Mode Schedule with the name.
Parameters
-ActiveEndDate
Specifies the end date and the end time when the schedule will stop.
If you don't specify this parameter, the schedule will continue to run until it is deleted or disabled.
For instance, if you want to create a schedule that should end on 1st May 2016 at 9:00 AM, you must specify "01-05-2016 09:00:00" as the ActiveEndDate.
You can pass a string specifying the time you want in your local time.
However, if you want to specify a UTC time, you need to specify a DateTime object with the DateTimeKind set to UTC.
Parameter properties
Type:
DateTime
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
6
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ActiveStartTime
Specifies the start date and the time when the schedule must go active.
For example, if you want a schedule that should begin from 1st May 2016 and must run at 9:00 AM, you must specify "01-05-2016 09:00:00" as the ActiveStartTime.
You can pass a string specifying the time you want in your local time.
However, if you want to specify a UTC time, you need to specify a DateTime object with the DateTimeKind.
Parameter properties
Type:
DateTime
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
5
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Comments
Specifies any human readable comments for a maintenance schedule.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
9
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ComputerName
Specifies an array of names of computers.
The cmdlet establishes temporary connections with management groups for these computers.
You can use NetBIOS names, IP addresses, or fully qualified domain names (FQDNs).
To specify the local computer, type the computer name, localhost, or a dot (.).The System Center Data Access service must be active on the computer.
If you do not specify a computer, the cmdlet uses the computer for the current management group connection.
Parameter properties
Type:
String[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Credential
Specifies a PSCredential object for the management group connection.
To obtain a PSCredential object, use the Get-Credential cmdlet.
For more information, type Get-Help Get-Credential.If you specify a computer in the ComputerName parameter, use an account that has access to that computer.
The default is the current user.
Parameter properties
Type:
PSCredential
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Duration
Specifies the duration of the maintenance schedule.
The duration of a maintenance schedule is the time for which the maintenance schedule will last each time.
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
7
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Enabled
Indicates whether the schedule will be enabled or disabled upon edit.
If you set this to false, the schedule will be disabled.
You can also use the Enable-SCOMMaintenanceSchedule and Disable-SCOMMaintenanceSchedule to do this.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
3
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-FreqInterval
Specifies the day that the job is run.
This is mandatory if the schedule is anything other than OnceRecurrence schedule.
The value depends on the value of FreqType as indicated in the following list:
1 (once). Frequency interval is unused.
4 (daily). Every frequency interval days.
8 (weekly). The FreqInterval parameter is one or more of the following (combined with an OR logical operator):
Number of weeks or months between the scheduled run of the job.
FreqRecurrenceFactor is used only if the FreqType paramter is set to 8, 16, or 32.
The FreqRecurrenceFactor parameter is an integer, with a default value of 0.
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
12
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-FreqRelativeInterval
Specifies the schedule when the FreqType parameter is set to 32 (monthly relative).
This parameter can be one of the following values:
1 (First)
2 (Second)
4 (Third)
8 (Fourth)
16 (Last)
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
13
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-FreqType
Specifies when the job is to be executed.
This parameter can be one of the following values:
1 (once)
4 (daily)
8 (weekly)
16 (monthly)
32 (Monthly, relative to parameter FreqInterval).
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
10
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-MonitoringObjects
Specifies an array of GUIDs representing monitoring objects that this cmdlet places into maintenance mode.
Specifies an array of monitoring objects GUIDS that is placed into maintenance mode.
To specify a monitoring object that the schedule places into maintenance mode, you must pass the ID attribute of the monitoring object.
If you want to retain some of the existing members, those also must be specified.
You can specify one or more monitoring objects for a schedule.
However, you cannot edit a schedule that does not have any monitoring object.
Parameter properties
Type:
Guid[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
4
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Name
Specifies the name of the schedule.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
1
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ReasonCode
Specifies the reason code for a maintenance schedule that specifies the reason for the maintenance window.
Indicates that the schedule is applicable to the top level resource or to all the contained resources as well.
If you set this parameter to false, only the specified resource will go into maintenance mode when the schedule is run.
If this is set to true, the specified resource and all resources that have a containment relationship with this resource will also go into maintenance mode.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
2
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ScheduleId
Specifies the GUID of the schedule that this cmdlet edits.
Parameter properties
Type:
Guid
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
0
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-SCSession
Specifies an array of Connection objects.
Parameter properties
Type:
Connection[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.