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 Overridable ReadOnly Property AutomaticExecutionParameters As SPHealthAnalysisRuleAutomaticExecutionParameters
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.


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;
Public Overrides ReadOnly Property AutomaticExecutionParameters() As SPHealthAnalysisRuleAutomaticExecutionParameters
        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


SPHealthAnalysisRule Class

SPHealthAnalysisRule Members

Microsoft.SharePoint.Administration.Health Namespace