Export (0) Print
Expand All

SPHealthAnalysisRuleAutomaticExecutionParameters class

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

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

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

[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPHealthAnalysisRuleAutomaticExecutionParameters

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.

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;
    }
}

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

Community Additions

ADD
Show:
© 2014 Microsoft