Enable-Rule

Enable-Rule

Enables a rule.

Syntax

Parameter Set: FromRule
Enable-Rule [-Rule] <MonitoringRule> [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Enables a rule. The cmdlet will not work on a rule that is part of a sealed management pack.

Parameters

-Rule<MonitoringRule>

Specifies the rule to enable. The parameter value must be an object that represents the rule. You can retrieve such an object by using Get-Rule.

Aliases

none

Required?

true

Position?

1

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

Notes

  • For more information, type "Get-Help Enable-Rule -detailed". For technical information, type "Get-Help Enable-Rule -full".
    When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

Examples

-------------- EXAMPLE 1 --------------

This command enables a monitoring rule named 'myrule' if such a rule exists outside of a sealed management pack.

C:\PS>get-rule -criteria 'Name =''myrule''' | enable-rule

Disable-Rule

Get-Rule