Skip to content

SPHealthAnalyzerRuleState

dscbot edited this page Mar 17, 2023 · 18 revisions

SPHealthAnalyzerRuleState

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key String The name of the rule exactly as it appears in central admin
Enabled Required Boolean Should the rule be enabled?
RuleScope Write String What is the scope of this rule All Servers, Any Server
Schedule Write String How often should the rule check Hourly, Daily, Weekly, Monthly, OnDemandOnly
FixAutomatically Write Boolean Should the rule fix itself automatically

Description

Type: Distributed Requires CredSSP: No

This resource is used to configure Health Analyzer rules for the local farm. The resource is able to enable/disable and configure the specified rule.

Examples

Example 1

This example shows how to disable a health analyzer rule

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPHealthAnalyzerRuleState DisableDiskSpaceRule
        {
            Name                 = "Drives are at risk of running out of free space."
            Enabled              = $false
            RuleScope            = "All Servers"
            Schedule             = "Daily"
            FixAutomatically     = $false
            PsDscRunAsCredential = $SetupAccount
        }
    }
}
Clone this wiki locally