Prototyping and debugging Exchange event sinks

While Exchange event sinks might work well during controlled testing, unexpected problems may arise once you deploy them in your live environment.

Please let others know how useful this tip is via the rating scale at the end of it. Do you have a useful Exchange

or Outlook tip, timesaver or workaround to share? Submit it to our tip contest and you could win a prize.


Exchange event sinks are pieces of code that are triggered by specific Exchange events. For instance, an administrator can create an event sink that fires when a piece of e-mail is received, or when other specified conditions arise. This makes it possible to customize or add to Exchange's functionality in many ways.

Event sinks can be useful, but they can also be tricky. What works perfectly well in controlled testing may not work in a live environment at all, no thanks to unexpected interactions between user accounts and mailbox permissions, or the vagaries of e-mail in general. Because of this, if you're writing custom event sinks for your organization that are going to be deployed as compiled objects (.DLLs), the live debugging process can be painful and complicated.

.DLLs for event sinks not only have to be registered with the system, but run in the context of a specific COM+ application. If you have to take a .DLL offline and replace it with an updated version, the procedure usually goes something like this:

  1. Un-register the event sink .DLL.
  2. Stop the COM+ app for this event sink.
  3. Compile a new version of the event sink if this hasn't been done already.
  4. Refresh and restart the COM+ app.
  5. Re-register the event sink.

Since the only way to reliably test an event sink is in situ, un-registering and re-registering successive versions of the same component can become tiresome and time-consuming. One way to work around problems like this is to code a prototype version of the event sink in VBScript and then later convert it to a .DLL in VB6. First, the code used can be virtually identical; the changes needed to make a VBScript program work as a full Visual Basic application are minimal. Second, the VBScript code can be edited on the fly and does not need to be removed and re-registered when changed.

About the author: Serdar Yegulalp is editor of the Windows Power Users Newsletter and a regular contributor to SearchExchange.com.


Do you have comments on this tip? Let us know.
Related information from SearchExchange.com:

  • Topics Library: Exchange scripts and programming



  • This was first published in May 2005

    Dig deeper on Microsoft Exchange Server Scripts and Programming

    Pro+

    Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    0 comments

    Oldest 

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to:

    SearchWindowsServer

    SearchEnterpriseDesktop

    SearchCloudComputing

    SearchSQLServer

    Close