Start-SCOMMaintenanceMode
Puts an object into maintenance mode and creates an active maintenance mode entry.
Syntax
Default (Default)
Start-SCOMMaintenanceMode
[-Instance] <MonitoringObject[]>
[-EndTime] <DateTime>
[[-Comment] <String>]
[[-Reason] <MaintenanceModeReason>]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Start-SCOMMaintenanceMode cmdlet puts a monitored object, such as a computer or distributed application, into maintenance mode and creates an active maintenance mode entry. When a resource is in maintenance mode, System Center - Operations Manager suppresses alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts.
Specify a class instance to put into maintenance mode and an end time for the maintenance window. You can also include a comment and a reason for the maintenance mode. You can use the Set-SCOMMaintenanceMode cmdlet to update an active maintenance mode entry and use the Get-SCOMMaintenanceMode cmdlet to get both active and inactive entries.
Examples
Example 1: Put a resource into maintenance mode
PS C:\>$Instance = Get-SCOMClassInstance -Name "Server01.Contoso.com"
PS C:\> $Time = ((Get-Date).AddMinutes(10))
PS C:\> Start-SCOMMaintenanceMode -Instance $Instance -EndTime $Time -Comment "Applying software update." -Reason "SecurityIssue"
This example puts a resource into maintenance mode for ten minutes. The first command gets the class instance named Server01.Contoso.com by using the Get-SCOMClassInstance cmdlet.
The second command creates a DateTime object for ten minutes in the future and then stores it in the $Time variable.
The third command puts the resource defined by the object stored in the $Instance variable into maintenance mode. Maintenance mode ends at the time stored in the $Time variable. The command includes a reason for maintenance mode and a comment.
Parameters
-Comment
Specifies a comment for the maintenance mode entry.
Parameter properties
Type: | String |
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 |
-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 |
-EndTime
Specifies when maintenance mode ends, as a DateTime object.
A resource cannot be in maintenance mode for fewer than five minutes.
To obtain a DateTime object, use the Get-Date cmdlet.
For more information, type Get-Help Get-Date
.
Parameter properties
Type: | DateTime |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 2 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Instance
Specifies an array of monitoring objects that represent instances. To obtain monitoring objects, use the Get-SCOMClassInstance cmdlet.
This parameter also accepts group objects. To obtain a group object, use the Get-SCOMGroup cmdlet.
Parameter properties
Type: | MonitoringObject[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 1 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-PassThru
Indicates that the cmdlet creates or modifies an object that a command can use in the pipeline. By default, this cmdlet does not generate any output.
Parameter properties
Type: | SwitchParameter |
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 |
-Reason
Specifies a reason for maintenance mode. The acceptable values for this parameter are:
- PlannedOther
- UnplannedOther
- PlannedHardwareMaintenance
- UnplannedHardwareMaintenance
- PlannedHardwareInstallation
- UnplannedHardwareInstallation
- PlannedOperatingSystemReconfiguration
- UnplannedOperatingSystemReconfiguration
- PlannedApplicationMaintenance
- ApplicationInstallation
- ApplicationUnresponsive
- ApplicationUnstable
- SecurityIssue
- LossOfNetworkConnectivity
Parameter properties
Type: | MaintenanceModeReason |
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 |
-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.