Share via


MOMScriptAPI.Return Method

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

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

MOMScriptAPI.Return(vVal)

Parameters

Parameter Type Description

vVal

Variant

The MOMDiscoveryData object or MOMPropertyBag object to submit.

Return Value

None.

Remarks

The Return method supports the following parameter types:

  • MOMPropertyBag object: After the name-value pairs have been created, the property bag is submitted by using the Return method. After the Return method has been called, no more name-value pairs can be created and submitted from the script. An example of this method is in the MOMScriptAPI.CreatePropertyBag method.

  • MOMDiscoveryData object: After the discovery data has been created, the data is submitted by using the Return method. After the Return method has been called, no more discovery data can be created and submitted from the script. An example of this method is in the MOMScriptAPI.CreateDiscoveryData method.

  • Simple values, such as a single numerical value.

If you must send multiple values back to the management server, use an instance of the MOMPropertyBag object as the parameter.

An example of the Return method is in the CreateDiscoveryData method and CreatePropertyBag method.

The Return method submits the data packet to Operations Manager. If you are running this script outside of Operations Manager, this XML string can be displayed in a console window. The management pack must be prepared and inserted as a rule to be run from Operations Manager.

To submit more than one object to Operations Manager, use MOMScriptAPI.AddItem with MOMScriptAPI.ReturnItems.

Requirements

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

Version: Requires Operations Manager 2007

See Also

Reference

MOMScriptAPI Object
MOMScriptAPI.ReturnItems Method
MOMScriptAPI.CreateDiscoveryData Method
MOMScriptAPI.CreatePropertyBag Method
MOMScriptAPI.CreateTypedPropertyBag Method