Microsoft Operations Manager

ScriptContext Object

The ScriptContextobject gets the MOM scripting objects. Use the ScriptContextobject to access and manipulate MOM alerts, events, performance data, and variable sets. The ScriptContextobject is automatically instantiated by the MOM scripting environment. The ScriptContextobject can be considered the root object for MOM scripts. The ScriptContextobject is capable of creating all of the other product objects by using methods, such as ScriptContext.CreateAlert, or through the return value of properties, such as the ScriptContext.Alertproperty.

Methods

Name Description

CreateAlert

Generates a new Alertobject.

CreateEvent

Generates a new Eventobject.

CreatePerfData

Generates a new PerfDataobject.

GetScriptState

Gets the ScriptStateobject.

IsAlert

Determines whether the object provided to the script by MOM is an Alertobject.

IsEvent

Determines whether the object provided to the script by MOM is an Eventobject.

IsPerfData

Determines whether the object provided to the script by MOM is a PerfDataobject.

Submit

Submits an Alert, Event, or PerfDataobject to the MOM data stream.

Properties

Name Description

Alert

Gets the Alertobject that caused MOM to invoke the script.

Event

Gets the Eventobject that caused MOM to invoke the script.

Parameters

Gets a VarSetobject that contains the parameters sent from MOM when the script was invoked.

PerfData

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

Requirements

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


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