HealthCheck.Execute Method
Runs the health check that has been defined for the security component.
Namespace: Microsoft.WindowsServerSolutions.SystemHealth.Infrastructure
Assembly: SHInfra (in shinfra.dll)
Assembly: SHInfra (in shinfra.dll)
The following code example shows how to initialize a new FeatureDetailGroup in a user-defined class and override the Execute method:
class AddinHealthCheck : HealthCheck
{
public AddinHealthCheck()
: base()
{
}
}
public override HealthCheckResult Execute()
{
HealthCheckResult result = new HealthCheckResult();
// Add code to get the status of the security component
...
// If no problems exist, set status to Ok
result.Status = SecurityFeatureHealthStatus.Ok;
// If there is a minor problem, set status to Warning
result.Status = SecurityFeatureHealthStatus.Warning;
// If there is a major problem, set status to Critical
result.Status = SecurityFeatureHealthStatus.Critical;
return result
}
Show: