Microsoft Operations Manager

IsEvent Method

The IsEventmethod determines whether the object provided to the script by MOM is an Eventobject.

[VBScript] ScriptContext.IsEvent()

Return Value

Long Integer


The following example shows how to create an alert from the Eventobject that caused MOM to invoke the script.

Function MakeAlertFromEvent()
	Dim objAlert
	Dim objEvent

	If (ScriptContext.IsEvent()) Then
		Set objEvent = ScriptContext.Event
		Set objAlert = ScriptContext.CreateAlert()

		objAlert.Computer = objEvent.SourceComputer
		objAlert.ComputerDomain = objEvent.SourceDomain
		objAlert.Description = objEvent.EventParameter(1)
		Set objAlert = Nothing
	End If

	Set objEvent = Nothing

	Set MakeAlertFromEvent = objAlert
End Function


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

See Also

ScriptContext Object, Event Object

Did you find this information useful? Please send your suggestions and comments about the documentation to