Enable-SCOMRule

Enable-SCOMRule

Creates and saves overrides that enable monitoring rules.

Syntax

Parameter Set: Empty
Enable-SCOMRule [-ManagementPack] <ManagementPack> [-Rule] <ManagementPackRule[]> [[-Enforce]] [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: FromGroup
Enable-SCOMRule [[-Group] <MonitoringObject[]> ] [-ManagementPack] <ManagementPack> [-Rule] <ManagementPackRule[]> [[-Enforce]] [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: FromInstance
Enable-SCOMRule [[-Instance] <MonitoringObject[]> ] [-ManagementPack] <ManagementPack> [-Rule] <ManagementPackRule[]> [[-Enforce]] [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: FromManagementPackClass
Enable-SCOMRule [-Class] <ManagementPackClass[]> [-ManagementPack] <ManagementPack> [-Rule] <ManagementPackRule[]> [[-Enforce]] [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Enable-SCOMRule cmdlet creates and saves overrides that enable System Center 2012 – Operations Manager monitoring rules.

Parameters

-Class<ManagementPackClass[]>

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.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Enforce

Indicates that Operations Manager enforces the override that enables the monitoring rules.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Group<MonitoringObject[]>

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

Aliases

none

Required?

false

Position?

1

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 instances, use the Get-SCOMClassInstance cmdlet. The cmdlet enable rules for these instances. 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

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

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue)

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.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Rule<ManagementPackRule[]>

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

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

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: Enable a monitoring rule for a management pack

This example enables 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 enables the monitoring rule stored in the $Rule variable for the class stored in the $Class variable. The command stores the override in the management pack stored in the $MP variable. The Enforce parameter specifies that Operations Manager enforces the override that enables the monitoring rules.

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:\> Enable-SCOMRule -Class $Class -Rule $Rule -ManagementPack $MP -Enforce

Disable-SCOMRule

Get-SCOMClass

Get-SCOMClassInstance

Get-SCOMGroup

Get-SCOMManagementPack

Get-SCOMRule