Skip to main content

Enable or Disable Rules

Problem

You want to enable or disable rules not sealed in a management pack.

Solution

To retrieve a rule, use the GetRule: $rule = GetRule | WhereObject { $_.DisplayName –match "RuleName" }

Then, use the EnableRule or DisableRule cmdlet to enable or disable that rule, respectively:

$rule | EnableRule

$rule | DisableRule

Discussion

For more information about the GetRule cmdlet, type GetHelp GetRule. For more information about the DisableRule cmdlet, type GetHelp DisableRule. For more information about the EnableRule cmdlet, type GetHelp EnableRule.

Help Category