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)
Usage
Syntax
'Declaration
Public MustOverride Function Execute As HealthCheckResult
public abstract HealthCheckResult Execute ()
public:
virtual HealthCheckResult^ Execute () abstract
public abstract HealthCheckResult Execute ()
public abstract function Execute () : HealthCheckResult
Return Value
Returns HealthCheckResult.
Example
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
}
Remarks
This method must be overridden in a user-defined class.
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.
Platforms
Development Platforms
Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008, and Windows 2000
Target Platforms
See Also
Reference
HealthCheck Class
HealthCheck Members
Microsoft.WindowsServerSolutions.SystemHealth.Infrastructure Namespace