The RegEvent Script
Topic Last Modified: 2006-06-12
Microsoft® Exchange Server 2007 provides a script that you can use to register, enumerate, and delete event registrations. This Microsoft Visual Basic® Scripting Edition (VBScript) code might also prove useful when developing your own registration scripts. RegEvent.vbs is installed with the Exchange Server 2003 Software Development Kit (SDK). By default, it is installed in the \Program Files\Exchange SDK\SDK\Support\OLEDB\Scripts directory.
Running RegEvent.vbs with no arguments returns the parameters as well as examples of use. Following is the syntax for RegEvent.vbs:
cscript RegEvent.vbs Add|Delete|Enum EventMethod SinkClass Registration Item Name(Scope) StartTime Interval [-p Priority] [-m MatchScope] [-f CriteriaFilter] [-file ScriptFilePath] [-url ScriptUrl] [-e ExpiryTime]
The parameters are defined as follows:
The name of the store or system event should be one or more of the following:
OnSave, OnDelete, OnSyncSave, OnSyncDelete, OnMdbStartup, OnMdbShutDown, or OnTimer.
Case is ignored. Multiple events can be specified in the same registration by placing semicolons (;) between the names of each event. For example, "OnSave;OnDelete".
The class identifier (in registry format) or programmatic identifier (PROGID) of your event sink. For example, "MySinks.SaveSink.1".
The name of the event registration item. The event scope is defined by where you save it. For example, file://./backofficestorage/domain/public%20folders/myfolder/EventRegItem1 registers for events in "myfolder".
When to start the OnTimer event. For example, "8/4/98 01:50:00 AM".
The time, in minutes, between each OnTimer event notification.
[optional] The priority of the registration. See Event Notification Priority.
[optional] The scope for the event registration. The scope can be one of the following: DEEP | SHALLOW | EXACT | ANY. The default is EXACT.
The scope ANY can only be used for registering store-wide events, which may only be registered in the following public and mailbox folders:
For more information, see Registering for Store-Wide Events.
[optional] The full file path to the event sink script file. If a script host is specified by the SinkClass PROGID or class identifier (CLSID), ScriptFilePath points to a script file in the file system.
[optional] The full HTTP URL of the event sink script file. If a script host is specified by the SinkClass PROGID or CLSID, ScriptURL points to a script in the Exchange store.
[optional] When to stop the OnTimer event. For example, "8/4/99 01:50:00 AM".
Exchange must be running for you to create event registrations.
You cannot register for the OnTimer event with any other events.
You cannot register for system events and synchronous events or asynchronous events in the same command. For example, "Regevent Add OnSave;OnMDBStartup" is not allowed.
For parameter definitions and examples of each call you can make with regevent.vbs, see Managing Event Registrations with RegEvent.vbs.