Share via


SPHealthAnalysisRule.AutomaticExecutionParameters property

Gets the default settings that specify when and where the rule is run.

Namespace:  Microsoft.SharePoint.Administration.Health
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property AutomaticExecutionParameters As SPHealthAnalysisRuleAutomaticExecutionParameters
    Get
'Usage
Dim instance As SPHealthAnalysisRule
Dim value As SPHealthAnalysisRuleAutomaticExecutionParameters

value = instance.AutomaticExecutionParameters
public virtual SPHealthAnalysisRuleAutomaticExecutionParameters AutomaticExecutionParameters { get; }

Property value

Type: Microsoft.SharePoint.Administration.Health.SPHealthAnalysisRuleAutomaticExecutionParameters
In the base class, this property returns a null reference (Nothing in Visual Basic). You do not need to override the property if your intent is to require a farm administrator to manually schedule when the rule should run. However, if you want your rule to be automatically scheduled when it is registered with the farm, you should override the property and in the get accessor return an SPHealthAnalysisRuleAutomaticExecutionParameters object that encapsulates the default settings for the rule.

Examples

The following example shows the implementation of the AutomaticExecutionParameters property in a class derived from the SPHealthAnalysisRule class.

public override SPHealthAnalysisRuleAutomaticExecutionParameters AutomaticExecutionParameters
{
    get
    {
        SPHealthAnalysisRuleAutomaticExecutionParameters retval = new SPHealthAnalysisRuleAutomaticExecutionParameters();
        retval.Schedule = SPHealthCheckSchedule.Hourly;
        retval.Scope = SPHealthCheckScope.All;
        retval.ServiceType = typeof(SPTimerService);
        retval.RepairAutomatically = false;
        return retval;
    }
}
Public Overrides ReadOnly Property AutomaticExecutionParameters() As SPHealthAnalysisRuleAutomaticExecutionParameters
    Get
        Dim retval As New SPHealthAnalysisRuleAutomaticExecutionParameters()
        retval.Schedule = SPHealthCheckSchedule.Hourly
        retval.Scope = SPHealthCheckScope.All
        retval.ServiceType = GetType(SPTimerService)
        retval.RepairAutomatically = False
        Return retval
    End Get
End Property

See also

Reference

SPHealthAnalysisRule class

SPHealthAnalysisRule members

Microsoft.SharePoint.Administration.Health namespace