Registering for events

You must create an event registration for each Exchange folder in which events are generated. The event registration is stored in a hidden file that is bound to the Event Listener; when the Microsoft Information Store Service starts, it searches for event registration files and adds the specified folders to the list of monitored folders.

You can create an event registration for a single folder (shallow registration), for a parent folder and all of its subfolders (deep registration), or for all of the folders in an organization (store-wide registration).

Event registrations are easily created with the Exchange Explorer GUI. They can also be created with the RegEvent.vbs utility. The following sections describe how to create event registrations with these tools.

Creating event registrations with Exchange Explorer

Exchange Explorer is a GUI for creating event registrations. It is available as a download from the Microsoft Web site.

Tip

You can locate the Exchange Explorer download by specifying the following search criteria on the Microsoft download page (www.microsoft.com/downloads):

  • Specify that you want to search for Exchange products, and specify the keyword SDK.
  • When the search results are returned, select the Exchange SDK Tools category.
  • Locate and download the file exchangesdktools.exe. Follow the instructions provided on the Microsoft Web site for downloading and installing.

Start Exchange Explorer by clicking Start --> Programs --> Exchange SDK --> Exchange SDK Development Tools --> Exchange Explorer. When you are prompted to log on in the Authorization dialog box, enter the following values:

Creating a shallow event registration

Perform the following steps to create a shallow event registration for a folder:

  1. Ensure that you have started Exchange Explorer and logged on.
  2. In the Exchange Store Hierarchy pane, select the folder you want to register.
  3. Click File --> Add Event Registration. The Exchange Store Event Sink Registration Wizard opens, and prompts you to choose a name for the event registration.
  4. In the Enter a name for this event sink registration field, type the name you want to use, and then click Next.
  5. The wizard asks you to specify the type of events you want to register for. Click Synchronous, and then click Next.
  6. The wizard asks you to specify the types of synchronous events you want to register for. Click both OnSyncSave and OnSyncDelete, and then click Next.
  7. The wizard asks you to specify the scope of your event registration. Click Shallow, and then click Next.
  8. The wizard asks you to specify the type of event sink you are registering. Click COM Event Sink, and then click Next.
  9. The wizard asks you to specify the event sink class. In the What is the ProgID of your event sink class? field, type BIA_Exchange.Events.1, and then click Next.
  10. The wizard prompts you to verify the choices you have made. When you are satisfied with your event registration, click Finish to exit the wizard.

The event registration is created. Every time an item is created, updated, or deleted in the registered folder, an event is sent to Event Listener.

Note:
If you encounter an error creating the registration item, see Troubleshooting and error handling.

Creating a deep event registration

Perform the following steps to create a deep event registration (the parent folder and all of its subfolders are registered):

  1. Ensure that you have started Exchange Explorer and logged on.
  2. In the Exchange Store Hierarchy pane, select the folder you want to register.
  3. Click File --> Add Event Registration. The Exchange Store Event Sink Registration Wizard opens, and prompts you to choose a name for the event registration.
  4. In the Enter a name for this event sink registration field, type the name you want to use, and then click Next.
  5. The wizard asks you to specify the type of events you want to register for. Click Synchronous, and then click Next.
  6. The wizard asks you to specify the types of synchronous events you want to register for. Click both OnSyncSave and OnSyncDelete, and then click Next.
  7. The wizard asks you to specify the scope of your event registration. Click Deep, and then click Next.
  8. The wizard asks you to specify the type of event sink you are registering. Click COM Event Sink, and then click Next.
  9. The wizard asks you to specify the event sink class. In the What is the ProgID of your event sink class? field, type BIA_Exchange.Events.1, and then click Next.
  10. The wizard prompts you to verify the choices you have made. When you are satisfied with your event registration, click Finish to exit the wizard.

The event registration is created. Every time an item is created, updated, or deleted in the registered folder or any of its subfolders, an event is sent to Event Listener.

Note:
If you encounter an error creating the registration item, see Troubleshooting and error handling.

Creating a store-wide event registration

Store-wide (or global) event registration for private mailbox stores can be done only in the following folder, where domain specifies your email domain and GUID specifies the SystemMailbox global unique ID: file://./backofficestorage/domain/mbx/SystemMailbox{GUID} /StoreEvents/GlobalEvents.

In addition, you must have the appropriate permissions to create a store-wide event registration. Global events can be registered only by a member of the Administrator or Domain Administrators group, or by a user in the Exchange Administrators role.

Perform the steps described in Creating a shallow event registration or Creating a deep event registration to create the appropriate store-wide event registration.

Creating event registrations with RegEvent.vbs

The RegEvent.vbs utility can create shallow, deep, and store-wide event registrations. For detailed information on using the RegEvent.vbs utility to create shallow and deep event registrations, refer to the Microsoft Developer Network (MSDN) Library and Knowledge Base (www.msdn.microsoft.com), and search for the keyword RegEvent.

Creating a store-wide event registration with RegEvent.vbs

Store-wide (or global) event registration for private mailbox stores can be done only in the following folder, where domain specifies your email domain and GUID specifies the SystemMailbox global unique ID: file://./backofficestorage/domain/mbx/SystemMailbox{GUID} /StoreEvents/GlobalEvents.

In addition, you must have the appropriate permissions to create a store-wide event registration. Global events can be registered only by a member of the Administrator or Domain Administrators group, or by a user in the Exchange Administrators role.

Enter the following command to create a store-wide event registration:

cscript RegEvent.vbs Add "OnSyncSave;OnSyncDelete" \
BIA_Exchange.Events.1 "file://./backofficestorage/domain/mbx \
/SystemMailbox{GUID}StoreEvents/GlobalEvents/globalSynchReg.eml" \ 
-m ANY

Copyright IBM Corp. 1997, 2003