Share via


MOMScriptAPI Object

Applies To: Operations Manager 2007 R2, Operations Manager 2007 SP1, System Center Operations Manager 2007

The MOMScriptAPI object is the top-level object for the scripting API.

Methods

Name Description

MOMScriptAPI.AddItem

Adds a MOMPropertyBag object or a MOMDiscoveryData object into a MOMScriptAPI internal array.

MOMScriptAPI.CreateDiscoveryData

Creates a new MOMDiscoveryData object, which stores discovery data and is used to submit the collected data back to Operations Manager.

MOMScriptAPI.CreatePropertyBag

Creates a new MOMPropertyBag object, which is used to temporarily store operations data (such as discovery, event, alert, or performance data) as a collection of name-value pairs.

MOMScriptAPI.CreateTypedPropertyBag

Creates a new MOMPropertyBag object that allows for type checking against the specified data type.

MOMScriptAPI.GetScriptStateKeyPath

Retrieves a safe registry path to which data can be written and shared between scripts.

MOMScriptAPI.LogScriptEvent

Writes a message to the Operations Manager event log.

MOMScriptAPI.Return

Submits a MOMDiscoveryData or MOMPropertyBag object back to Operations Manager and completes the script.

MOMScriptAPI.ReturnItems

Submits multiple MOMDiscoveryData or MOMPropertyBag objects back to Operations Manager and completes the script.

Properties

None.

Examples

The following example shows how to create a new instance of the MOMScriptAPI object.

var objScriptAPI = new ActiveXObject('MOM.ScriptAPI');
Dim objScriptAPI
Set objScriptAPI = CreateObject("MOM.ScriptAPI")

Requirements

Platforms: Requires Windows Server 2003, Windows Vista, or Windows Server 2008

Version: Requires Operations Manager 2007

Remarks

The MOMScriptAPI methods are used to create new MOMPropertyBag objects or MOMDiscoveryData objects and then submit them back to the Operations Manager management server.

You can also use the MOMScriptAPI object to submit monitoring data back to the Operations Manager management server, determine a safe registry path for written data, and log script events.

See Also

Other Resources

Operations Manager 2007 R2 Scripting Objects