AutomaticExecutionParameters property

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)

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.

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

public override SPHealthAnalysisRuleAutomaticExecutionParameters AutomaticExecutionParameters
        SPHealthAnalysisRuleAutomaticExecutionParameters retval = new SPHealthAnalysisRuleAutomaticExecutionParameters();
        retval.Schedule = SPHealthCheckSchedule.Hourly;
        retval.Scope = SPHealthCheckScope.All;
        retval.ServiceType = typeof(SPTimerService);
        retval.RepairAutomatically = false;
        return retval;
© 2015 Microsoft