Export (0) Print
Expand All

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)

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

value = instance.AutomaticExecutionParameters

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 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
Show:
© 2015 Microsoft