Problem solve Get help with specific problems with your technologies, process and projects.

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

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

  • Topics Library: Exchange scripts and programming

  • Dig Deeper on Exchange Server setup and troubleshooting

    Start the conversation

    Send me notifications when other members comment.

    Please create a username to comment.