LocalAlertManager.GetAllLocalAlerts Method ()
Returns a collection of the Alert objects that represents the active alerts on the local computer.
Namespace: Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework
Assembly: AlertFramework (in AlertFramework.dll)
Syntax
public ReadOnlyAlertCollection GetAllLocalAlerts()
public:
ReadOnlyAlertCollection^ GetAllLocalAlerts()
Public Function GetAllLocalAlerts As ReadOnlyAlertCollection
Return Value
Type: Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework.ReadOnlyAlertCollection
A ReadOnlyAlertCollection that contains the Alert objects.
Examples
The following code example shows how to get all of the local alerts:
LocalAlertManager localAlertManager = new LocalAlertManager();
ReadOnlyAlertCollection alerts = localAlertManager.GetAllLocalAlerts();
Console.WriteLine("Total number of active critical alerts is: {0}",
alerts.CountActiveCritical());
Console.WriteLine("Total number of active critical information is: {0}",
alerts.CountActiveInformation());
Console.WriteLine("Total number of active critical warning is: {0}",
alerts.CountActiveWarning());
See Also
LocalAlertManager Class
Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework Namespace
Return to top