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:
EventMethod (Add)
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".
SinkClass (Add)
The class identifier (in registry format) or programmatic identifier (PROGID) of your event sink. For example, "MySinks.SaveSink.1".
Registration Item Name (Add|Delete|Enum)
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".
StartTime (OnTimer)
When to start the OnTimer event. For example, "8/4/98 01:50:00 AM".
Interval (OnTimer)
The time, in minutes, between each OnTimer event notification.
Priority (Add for OnSyncSave and OnSyncDelete)
[optional] The priority of the registration. See Event Notification Priority.
MatchScope (Add for synchronous and asynchronous notifications)
[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:
file://./backofficestorage/ADMIN/%userdnsdomain%/MBX/SystemMailbox{GUID}/Storeevents/GlobalEvents
file://./backofficestorage/ADMIN/%userdnsdomain%/Public Folders/Non_ipm_subtree/StoreEvents{GUID}/GlobalEvents
For more information, see Registering for Store-Wide Events.
CriteriaFilter (Add)
[optional] An SQL WHERE clause of conditions for notification. For example, WHERE "DAV:ishidden" = FALSE. For more information, see the Criteria Field page of Event Registration Items.
ScriptFilePath (Add)
[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.
ScriptUrl (Add)
[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.
ExpiryTime (OnTimer)
[optional] When to stop the OnTimer event. For example, "8/4/99 01:50:00 AM".
Remarks
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.