Disable-SCOMMonitor

Disables monitors in Operations Manager.

Syntax

Disable-SCOMMonitor
       [-Monitor] <ManagementPackMonitor[]>
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMMonitor
       [-Monitor] <ManagementPackMonitor[]>
       [[-Instance] <MonitoringObject[]>]
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMMonitor
       [-Monitor] <ManagementPackMonitor[]>
       [[-Group] <MonitoringObject[]>]
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMMonitor
       [-Monitor] <ManagementPackMonitor[]>
       [-Class] <ManagementPackClass[]>
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

The Disable-SCOMMonitor cmdlet disables monitors in System Center 2016 - Operations Manager. In Operations Manager, monitors define logic for determining the health of an object. The cmdlet disables monitors by creating and saving overrides that modify the default behavior of a monitor.

Examples

Example 1: Disable a monitor

PS C:\>$MP = Get-SCOMManagementPack -DisplayName "My SQL MP Customization" | where {$_.Sealed -eq $False}
PS C:\> $Class = Get-SCOMClass -DisplayName "SQL DB Engine"
PS C:\> $Monitor = Get-SCOMMonitor -DisplayName "*memory*"
PS C:\> Disable-SCOMMonitor -Class $Class -ManagementPack $MP -Monitor $Monitor -Enforce

This example disables an Operations Manager monitor.

The first command uses the Get-SCOMManagementPack cmdlet to get a management pack object, and it stores the result in the variable named $MP.

The second command uses the Get-SCOMClass cmdlet to get a class object, and it stores the result in the variable named $Class.

The third command uses the Get-SCOMMonitor cmdlet to get a monitor object, and it stores the result in the variable named $Monitor.

The fourth command uses the Disable-SCOMMonitor cmdlet to disable the monitor by using the Enforce parameter. The cmdlet stores the override in the variable named $MP.

Parameters

-Class

Specifies an array of class objects. For information about how to get a class object, type "Get-Help Get-SCOMClass".

Type:ManagementPackClass[]
Position:1
Default value:None
Required:True
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

-Enforce

Indicates that the cmdlet sets the Enforce property on the override to $True.

Type:SwitchParameter
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Group

Specifies an array of one or more group objects. For information about how to get a group object, type "Get-Help Get-SCOMGroup".

Type:MonitoringObject[]
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Instance

Specifies an array of class instance objects. The Instance parameter also accepts group objects as input. For information about how to get a class instance object, type "Get-Help Get-SCOMClassInstance".

Type:MonitoringObject[]
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ManagementPack

Specifies one or more management pack objects where you can save the override. If the monitor is in an unsealed management pack, you must save the overrides into the same management pack. For information about how to get a management pack object, type "Get-Help Get-SCOMManagementPack".

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

-Monitor

Specifies an array of one or more monitor objects. For information about how to get a monitor object, type "Get-Help Get-SCOMMonitor".

Type:ManagementPackMonitor[]
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters: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.

Type:SwitchParameter
Position:4
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