Start-SCOMMaintenanceMode

Start-SCOMMaintenanceMode

Puts an object into maintenance mode and creates an active maintenance mode entry.

Syntax

Parameter Set: FromInstance
Start-SCOMMaintenanceMode [-Instance] <MonitoringObject[]> [-EndTime] <DateTime> [[-Comment] <String> ] [[-Reason] <MaintenanceModeReason> ] [-PassThru] [ <CommonParameters>]

Detailed 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 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-SCOMMaintenanceMode cmdlet to update an active maintenance mode entry and use the Get-SCOMMaintenanceMode cmdlet to get both active and inactive entries.

Parameters

-Comment<String>

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

-EndTime<DateTime>

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

-Instance<MonitoringObject[]>

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

-PassThru

Returns an object representing the item with which you are working. 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

-Reason<MaintenanceModeReason>

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

<CommonParameters>

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).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Put a resource into maintenance mode

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" 

Get-SCOMMaintenanceMode

Set-SCOMMaintenanceMode

Get-SCOMClassInstance

Get-SCOMGroup

Get-Date