Get-SCOMMaintenanceMode

Get-SCOMMaintenanceMode

Gets maintenance mode entries.

Syntax

Parameter Set: FromInstance
Get-SCOMMaintenanceMode [[-Instance] <MonitoringObject[]> ] [[-History]] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Detailed Description

The Get-SCOMMaintenanceMode cmdlet gets maintenance mode entries. You can use this cmdlet to provide objects to the Set-SCOMMaintenanceMode cmdlet, or by itself to see details about maintenance mode entries.

When a resource is in maintenance mode, System Center 2012 – Operations Manager suppresses alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts.

When you use this cmdlet by itself, it presents information for the local time. If you pipe its results to the Format-Table cmdlet, the cmdlet provides information in Coordinated Universal Time (UTC). For more information about Format-Table, type, Get-Help Format-Table.

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.

Parameters

-ComputerName<String[]>

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 running on the computer. If you do not specify a computer, the cmdlet uses the computer for the current management group connection.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Credential<PSCredential>

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 value is the current user.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-History

Indicates that the cmdlet gets all maintenance mode entries, including inactive entries. Without this parameter, the cmdlet gets only active maintenance mode entries.

Aliases

none

Required?

false

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?

false

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-SCSession<Connection[]>

Specifies an array of Connection objects. To obtain a Connection object, use the Get-SCOMManagementGroupConnection cmdlet.

Aliases

none

Required?

false

Position?

named

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: Get all active maintenance mode entries

This command gets all active maintenance mode entries. In order to include inactive entries, specify the History parameter.

PS C:\> Get-SCOMMaintenanceMode

Example 2: Get all active maintenance mode entries for a specified domain

This command gets all active maintenance mode entries for class instances in the Contoso.com domain. The command uses the Get-SCOMClassInstance cmdlet to get the instances that contain Contoso.com.

If the command encounters a class instance that lacks active maintenance mode entries, the ErrorAction parameter allows the command to continue without displaying an error.

PS C:\> Get-SCOMMaintenanceMode -Instance (Get-SCOMClassInstance -Name "*.Contoso.com") -ErrorAction SilentlyContinue

Example 3: Get all maintenance mode entries for a specified domain

This command gets all class instances in the Contoso.com domain and then uses the pipeline operator (|) to pass the class instance objects to the Get-SCOMMaintenanceMode cmdlet. This example uses the History parameter; therefore, the command gets all maintenance mode entries, including inactive entries.

PS C:\> Get-SCOMClassInstance -Name "*.Contoso.com" | Get-SCOMMaintenanceMode -History

Get-SCOMClassInstance

Set-SCOMMaintenanceMode

Start-SCOMMaintenanceMode

Get-SCOMGroup

Get-SCOMManagementGroupConnection

Get-Credential