To create discovery data you must first create a MOMScriptAPI object.
After a MOMScriptAPI object is created, you can create a discovery data object. The MOMScriptAPI.CreateDiscoveryData method takes three parameters—dwSourceType, bstrSourceId, and bstrManagedEntityId.
The GUID of the discovery object that launched the script is passed into the script as $MPElement$ and the GUID of the object that the script is executing against is passed in as $Target/Id$.
After the MOMDiscoveryData object is created, you can create instances and relationships to be submitted to Operations Manager.