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!

December 11th, 2007 at 8:59 am
[…] http://www.systemcenterforum.org/writing-and-debugging-opsmgr-2007-scripts-without-a-console/ shows how to test scripts in the […]
March 11th, 2008 at 3:52 am
[…] 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 […]
September 12th, 2008 at 1:51 pm
[…] http://www.systemcenterforum.org/writing-and-debugging-opsmgr-2007-scripts-without-a-console/ shows how to test scripts in the […]