ScriptContext.Event Property

Gets the Event object that caused MOM to invoke the script.

 ScriptContext.Event

Access

Read/Write

Return Value

Object

Examples

The following example shows how to create an alert from the Event object 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)
    Else
        Set objAlert = Nothing
    End If

    Set objEvent = Nothing

    Set MakeAlertFromEvent = objAlert
End Function

Requirements

Platforms: Requires Windows 2000 or later

Version: Requires MOM 2000  or later

See Also

ScriptContext Object | Event Object