This topic has not yet been rated - Rate this topic

SPHealthAnalysisRule.AutomaticExecutionParameters Property

SharePoint 2010

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)
public virtual SPHealthAnalysisRuleAutomaticExecutionParameters AutomaticExecutionParameters { get; }

Property Value

Type: Microsoft.SharePoint.Administration.Health.SPHealthAnalysisRuleAutomaticExecutionParameters
In the base class, this property returns null. 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.

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;
    }
}
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ