Using the Microsoft Script Debugger

To debug scripts that are running in the Microsoft Exchange Scripting Agent, you can use the Microsoft Script Debugger, which is available with Microsoft IIS version 4.0 or Microsoft Internet Explorer version 4.0. Because the Script Debugger is not included as part of Microsoft Exchange Server, you must install one of these other products. During installation, choose the Custom installation option and then select the Microsoft Script Debugger option.

The Microsoft Script Debugger performs only local debugging. Therefore, you must run the debugger on the computer on which the script is executing. In the case of the Microsoft Exchange Scripting Agent, this is the Microsoft Exchange Server computer on which the script is executing.

To force your script to hit a breakpoint and start the debugger, insert the following command into your script, under the event subroutine you wish to debug:

To use the Microsoft Script Debugger to step into Event Service code, you must first log on with the same Windows NT service account as the Microsoft Exchange Event Service itself; otherwise, the debugger will not be launched correctly when it reaches a stop (or debugger) statement in the code.

As soon as an event occurs that triggers your script's event subroutine, the script will halt, and you will see the currently running script in the debugger window at the line containing the stop or debugger statement. Inside the script debugger, you can step into or around statements and you can inspect the values of variables by using the immediate command window. See the documentation on Microsoft Script Debugger for more information on using this tool.