Writing and debugging OpsMgr 2007 scripts without a console

 

Q: Is there an Operations Manager 2007 equivalent of the ResponseTest Resource Kit utility?

A: According to the OpsMgr 2007 SDK, all you need to do is copy the MOMScriptAPI.dll from any management server to your workstation. Then use regsvr32 to register the dll, and you are ready to go! You can then write, run and debug Operations Manager runtime scripts on your XP or Vista workstation - no console required. Script output is returned to the screen in xml. This allows you to check the data being returned by your script before you go to the work

The problem: However, when I tried this, registering the dll failed with a “Loadlibrary (MOMScriptAPI.dll) failed” error.

The fix: A little work with Process Monitor revealed that the HealthServiceRuntime.dll was being called, but was absent. Simply copying HealthServiceRuntime.dll to the same directory as the MOMScriptAPI.dll and then running regsvr32 MOMScriptAPI.dll again solved the problem.

To Test: Perform the above steps and then run this simple ping script from a command line (which pings localhost). Propertybag data will be returned in your console.

Have fun!

2 Responses to “Writing and debugging OpsMgr 2007 scripts without a console”

  1. Andrzej's "IT Thoughts" Weblog : OpsMgr 2007 Authoring Resources Says:

    [...] http://www.systemcenterforum.org/writing-and-debugging-opsmgr-2007-scripts-without-a-console/ shows how to test scripts in the [...]

  2. System Center Forum - Scripting Tip: Valid Event ID ranges when using the MOMScriptAPI.LogScriptEvent method Says:

    [...] script the other day and received an ambiguous error message when I executed the script on my development workstation. (Incidentally, if you’re developing custom runtime scripts for Operations? Manager and [...]

Leave a Reply

privacy policy | terms of use | copyright © 2008 pete zerger