Compartir a través de


Edit-SCOMMaintenanceSchedule

Edits an existing maintenance schedule.

Syntax

Edit-SCOMMaintenanceSchedule
    [-ScheduleId] <Guid>
    [[-Name] <String>]
    [[-Recursive] <Boolean>]
    [[-Enabled] <Boolean>]
    [[-MonitoringObjects] <Guid[]>]
    [[-ActiveStartTime] <DateTime>]
    [[-ActiveEndDate] <DateTime>]
    [[-Duration] <Int32>]
    [[-ReasonCode] <MaintenanceModeReason>]
    [[-Comments] <String>]
    [[-FreqType] <Int32>]
    [[-FreqInterval] <Int32>]
    [[-FreqRecurrenceFactor] <Int32>]
    [[-FreqRelativeInterval] <Int32>]
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

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

PS C:\>Edit-SCOMMaintenanceSchedule -ScheduleId "32AAB279-3670-ED11-9626-00155D012405" -Enabled 1

Edits the Maintenance Mode Schedule with the ID 32AAB279-3670-ED11-9626-00155D012405.

2: Edit a System Center Operations Manager maintenance mode scheduled using its name

PS C:\>Edit-SCOMMaintenanceSchedule -Name "Test" -Enabled 1

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.

Type:DateTime
Position:6
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:DateTime
Position:5
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Comments

Specifies any human readable comments for a maintenance schedule.

Type:String
Position:9
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:Int32
Position:7
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:Boolean
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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):

---- 1 = Sunday ---- 2 = Monday ---- 4 = Tuesday ---- 8 = Wednesday ---- 16 = Thursday ---- 32 = Friday ---- 64 = Saturday

  • 16 (monthly). On the frequency interval day of the month.
  • 32 (monthly relative). The FreqInterval parameter is one of the following values:

---- 1 = Sunday ---- 2 = Monday ---- 3 = Tuesday ---- 4 = Wednesday ---- 5 = Thursday ---- 6 = Friday ---- 7 = Saturday ---- 8 = Day ---- 9 = Weekday ---- 10 = Weekend day

Type:Int32
Position:11
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FreqRecurrenceFactor

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.

Type:Int32
Position:12
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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)
Type:Int32
Position:13
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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).
Type:Int32
Position:10
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:Guid[]
Position:4
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the schedule.

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReasonCode

Specifies the reason code for a maintenance schedule that specifies the reason for the maintenance window.

Type:MaintenanceModeReason
Accepted values:PlannedOther, UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, UnplannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity
Position:8
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Recursive

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.

Type:Boolean
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ScheduleId

Specifies the GUID of the schedule that this cmdlet edits.

Type:Guid
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SCSession

Specifies an array of Connection objects.

Type:Connection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False