Platform SDK: Exchange 2000 Server

The Script Host Sink

[This is preliminary documentation and subject to change.]

The Script Host is a COM object instantiated by Exchange with instructions to execute a script method as an event sink. The Script Host Sink is capable of handling all Exchange events and then running the event script sinks in its own thread. To run a script, you register the Script Host Sink as your event sink class and then specify the script in the registration item's ScriptName property. See The Registration Item for registration item schema.

The following diagram shows the script host and related components.

The Script Host is typically wrapped by a COM+ Application package (formerly a MTS wrapper) so that the Script Host (and therefore the event script handler) can be given a security context. See COM+ Applications for more information on packaging event sinks to give them security contexts.

Note   You will likely wrap the Script Host more than once for differing security contexts.

It is not necessary for the developer to know the details of the Script Host Sink since all execution control from the sink source call to running the script are handled internally. See Script Event Naming Conventions for an explanation of how to properly name the methods in your scripted event sink handler.

The Script Host resides in exOLEDBESH.dll. It is registered with the installation of Exchange as ExOleDB.ScriptEventSink.

Objects cannot be created within event sink scripts

The event script is compiled and run within the Script Host process. The Script Host does not allow scripts to create objects.