Enable-SCOMRule
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Enable-SCOMRule
Enables monitoring rules by creating and saving overrides for the specified 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 enables monitoring rules by creating and saving overrides for the specified rules.
Parameters
-Class<ManagementPackClass>
Specifies one or more class objects for which the rules will be enabled. Enter a variable that represents the classes, or type a command that gets the classes. For information about how to get a class object, type Get-Help Get-SCOMClass.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Enforce
Indicates that the enforce property will be set to True on the override that is created to enable the specified monitoring rules.
Aliases |
none |
Required? |
false |
Position? |
3 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Group<MonitoringObject>
Specifies one or more group objects for which the rules will be enabled. Enter a variable that represents the groups, or type a command that gets the groups.For information about how to get a group object, type Get-Help Get-SCOMGroup.
Aliases |
none |
Required? |
false |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Instance<MonitoringObject>
Specifies one or more class instance objects for which the rules will be enabled. Enter a variable that represents the class instances, or type a command that gets the class instances. This parameter also accepts group objects.For information about how to get a class instance object, type Get-Help Get-SCOMClassInstance.
Aliases |
none |
Required? |
false |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-ManagementPack<ManagementPack>
Specifies one or more management pack objects into which the enabling override will be saved. If the rule is contained in an unsealed management pack, the overrides must be saved into the same management pack. Enter a variable that represents the management packs, or type a command that gets the management packs.For information about how to get a management pack object, type Get-Help Get-SCOMManagementPack.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-PassThru
Returns an object representing the monitoring rule. 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 one or more monitoring rule objects. Enter a variable that represents the monitoring rules, or type a command that gets the monitoring rules.
For information about how to get a monitoring rule object, type Get-Help Get-SCOMRule.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before executing the command.
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Describes what would happen if you executed the command without actually executing the command.
Required? |
false |
Position? |
named |
Default Value |
none |
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
Examples
-------------------------- EXAMPLE 1 --------------------------
Description-----------The first three commands get a 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 rule $Rule for the management pack $MP using the Enforce property.
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
Related topics
Get-SCOMClass
Get-SCOMClassInstance
Get-SCOMGroup
Get-SCOMManagementPack