Compartilhar via


SPHealthAnalysisRuleAutomaticExecutionParameters Class

Encapsulates the default parameters for running a SharePoint Health Analyzer rule automatically via the timer service.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.Health.SPHealthAnalysisRuleAutomaticExecutionParameters

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

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPHealthAnalysisRuleAutomaticExecutionParameters
'Usage
Dim instance As SPHealthAnalysisRuleAutomaticExecutionParameters
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPHealthAnalysisRuleAutomaticExecutionParameters

Remarks

You can use an instance of this class to specify default parameters for a rule that is run automatically through the timer service. You do in the get accessor for the AutomaticExecutionParameters property of your rule, where you should instantiate an SPHealthAnalysisRuleAutomaticExecutionParameters object and set its properties to specify the schedule on which the rule should run, whether it should run on all servers or just the first available server, the service that should run the rule (usually this will be the timer service), and whether the rule should automatically repair any faults that it detects..

Keep in mind that the settings specified by an instance of this class are defaults. They can be changed by a farm administrator through the Central Administration user interface.

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

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPHealthAnalysisRuleAutomaticExecutionParameters Members

Microsoft.SharePoint.Administration.Health Namespace