Start-SCOMMaintenanceMode
Puts an object into maintenance mode and creates an active maintenance mode entry.
Parameter Set: FromInstance
Start-SCOMMaintenanceMode [-Instance] <MonitoringObject[]> [-EndTime] <DateTime> [[-Comment] <String> ] [[-Reason] <MaintenanceModeReason> ] [-PassThru] [ <CommonParameters>]
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 2012 – 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-SCOMMainenanceMode cmdlet to update an active maintenance mode entry and use the Get-SCOMMainenanceMode cmdlet to get both active and inactive entries.
Specifies a comment for the maintenance mode entry.
Aliases |
none |
Required? |
false |
Position? |
3 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
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
.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
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.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
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
Aliases |
none |
Required? |
false |
Position? |
4 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
The input type is the type of the objects that you can pipe to the cmdlet.
The output type is the type of the objects that the cmdlet emits.
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.
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"