Enable-SCOMRule
Creates and saves overrides that enable monitoring rules.
Syntax
Empty (Default)
Enable-SCOMRule
[-Rule] <ManagementPackRule[]>
[-ManagementPack] <ManagementPack>
[-Enforce]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
FromGroup
Enable-SCOMRule
[-Rule] <ManagementPackRule[]>
[[-Group] <MonitoringObject[]>]
[-ManagementPack] <ManagementPack>
[-Enforce]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
FromInstance
Enable-SCOMRule
[-Rule] <ManagementPackRule[]>
[[-Instance] <MonitoringObject[]>]
[-ManagementPack] <ManagementPack>
[-Enforce]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
FromManagementPackClass
Enable-SCOMRule
[-Rule] <ManagementPackRule[]>
[-Class] <ManagementPackClass[]>
[-ManagementPack] <ManagementPack>
[-Enforce]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Enable-SCOMRule cmdlet creates and saves overrides that enable System Center - Operations Manager monitoring rules.
Examples
Example 1: Enable a monitoring rule for a management pack
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
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.
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.
Parameter properties
| Type: | ManagementPackClass[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
FromManagementPackClass
| Position: | 1 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Enforce
Indicates that Operations Manager enforces the override that enables the monitoring rules.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 3 |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Group
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.
Parameter properties
| Type: | MonitoringObject[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
FromGroup
| Position: | 1 |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Instance
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.
Parameter properties
| Type: | MonitoringObject[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
FromInstance
| Position: | 1 |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | 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.
Parameter properties
| Type: | ManagementPack |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 1 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | 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.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 4 |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Rule
Specifies an array of rules as ManagementPackRule objects. To obtain a ManagementPackRule object, use the Get-SCOMRule cmdlet.
Parameter properties
| Type: | ManagementPackRule[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 2 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.