Microsoft Operations Manager

IsAlert Method

The IsAlertmethod determines whether the object provided to the script by MOM is an Alertobject.

[VBScript] ScriptContext.IsAlert()

Return Value

Long Integer

Examples

The following example shows how to determine whether the object provided to the script by MOM is an Alertobject.

[VBScript] 
Function CreateNewAlert()
	Dim objCreatedAlert
	Dim objAlert

	Set objCreatedAlert = ScriptContext.CreateAlert()

	If (ScriptContext.IsAlert()) Then
		Set objAlert = ScriptContext.Alert

		objCreatedAlert.Name = objAlert.Name
		objCreatedAlert.AlertLevel = 50
		objCreatedAlert.Owner = "[unassigned]"
		objCreatedAlert.ResolutionState = 0  ' New
	Else
		Set objCreatedAlert = Nothing
	End If

	Set objAlert = Nothing

	Set CreateNewAlert = objCreatedAlert
End Function

Requirements

Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1

See Also

ScriptContext Object, Alert Object


Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.