Disable-SCOMRule

Creates and saves overrides that disable monitoring rules.

Syntax

Disable-SCOMRule
       [-Rule] <ManagementPackRule[]>
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMRule
       [-Rule] <ManagementPackRule[]>
       [[-Instance] <MonitoringObject[]>]
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMRule
       [-Rule] <ManagementPackRule[]>
       [[-Group] <MonitoringObject[]>]
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Disable-SCOMRule
       [-Rule] <ManagementPackRule[]>
       [-Class] <ManagementPackClass[]>
       [-ManagementPack] <ManagementPack>
       [-Enforce]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

The Disable-SCOMRule cmdlet creates and saves overrides that disable System Center - Operations Manager monitoring rules. After you disable a monitoring rule, Operations Manager no longer raises alerts for the systems specified in the rules.

Examples

Example 1: Disable a monitoring rule

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:\> $Rule = Get-SCOMRule -DisplayName "*Events/sec"
PS C:\> Disable-SCOMRule -Class $Class -Rule $Rule -ManagementPack $MP -Enforce

This example disables a monitoring rule for a management pack.

The first three commands get an unsealed management pack object, a class object, and a monitoring rule object and then store the objects in the $MP, $Class, and $Rule variables, respectively.

The last command disables the monitoring rule stored in $Rule for the class object stored in $Class. The command stores the override in the management pack stored in $MP. The command specifies the Enforce parameter.

Parameters

-Class

Specifies an array of management pack objects that represent classes for which the cmdlet disables rules. To obtain a ManagementPackClass object, use the Get-SCOMClass cmdlet.

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 Operations Manager enforces the override that disables the monitoring rules.

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

-Group

Specifies an array of monitoring objects that represent groups. To obtain a group object, use the Get-SCOMGroup cmdlet. The cmdlet disables rules for these groups.

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

-Instance

Specifies an array of monitoring objects that represent instances. To obtain instances, use the Get-SCOMClassInstance cmdlet. The cmdlet disables rules for these instances. This parameter also accepts group objects. To obtain a group object, use the Get-SCOMGroup cmdlet.

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

-ManagementPack

Specifies a management pack object that stores overrides. To obtain a management pack object, use the Get-SCOMManagementPack cmdlet. If the rule is in an unsealed management pack, you must save the override into the same management pack.

Type:ManagementPack
Position:1
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

-Rule

Specifies an array of rules as ManagementPackRule objects. To obtain a ManagementPackRule object, use the Get-SCOMRule cmdlet.

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