CDOLive LLC The Premier Resource for Microsoft Collaboration Data Objects             

Tips and Tricks

The Microsoft Exchange Event service runs each Microsoft Exchange Server Scripting and Routing script in the MAPI session of the last editor. To avoid any problems edit the script only with the respective mailbox. Create a new mailbox, which is only used to edit scripts, assign the mailbox the same Microsoft Windows NT account, which is used for the Exchange Event Service, as primary Microsoft Windows NT account and add your Windows NT account to that mailbox. Make sure that this mailbox has the appropriate permissions to edit and run Microsoft Exchange Server Scripting and Routing scripts. For more information about permissions and Exchange Scripting and Routing scripts, please take a look at The Secrets of Exchange Server Scripting and Routing, Permissions and Security.

If you are running Microsoft Active Desktop and Microsoft Script Debugger on the same machine, it is possible that your machine will stop responding. The only supported workaround is to disable the Microsoft Active Desktop. An unsupported way is to rename the Microsoft Script Debugger program file (mdm.exe) located at your windows system directory (e. g. c:\winnt\system32). Note that this produces some wired error messages at the Microsoft Windows NT EventLog, which can be ignored.

Also, it is possible that the Microsoft Exchange Event service stops working without any error messages. The only supported way by Microsoft seems to remove and re-install the Event service. However, an unsupported way is to stop the Event service, open a command line window, change to the Microsoft Exchange server directory (e. g. c:\exchsrvr\bin) and type Events.Exe /c:<YourServerName>. This will remove the Event service configuration system folder System Folders\Events Root\EventsConfig_<Your Server Name>. Note that sometimes it is necessary to run this command more than once until all occurrences of the system folder are removed.

Restart the Microsoft Exchange Event service and ignore the error messages in the Microsoft Windows NT server EventLog. Now you need to apply all permissions and scripts again. After that step everything should run without any problems.

Please note that all tips and tricks are provided without any warranties and without support neither from CDOLive nor from Microsoft. Please read our legal disclaimer before you use any tips and tricks provided below.

Change the Default Settings for the Event Service

The default delay between when an event trigger occurs and when the script is run, is 60 seconds. This can be changed for demonstration or testing purposes. In a production environment it is not a good idea to lower this trigger, because the performance of the machine will slow down.

To change the entry, perform the following steps:

Start the registry editor, regedit.exe

Open the following subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\Parameters

Add the following DWORD value:

ICS Notification Interval

Change this value to the number of seconds that you want the store to wait for replication notifications.

Note that there is a Microsoft Knowledge Base article Reducing Event Service Firing Delays available. For more information, please take a look at The Secrets of Exchange Server Scripting and Routing, Useful Links.

To debug a Microsoft Exchange Scripting and Routing script, it could be very helpful to get more detailed error messages in the Microsoft Windows NT EventLog. The Microsoft Exchange Event Service has a registry entry that controls this level. You can edit the registry entry to change this level. Setting this registry entry as described will log all agent log information to the Microsoft Windows NT EventLog. This is very useful to identify the Microsoft Exchange Server Scripting and Routing script, which has created the error.

To change the entry, perform the following steps:

Start the registry editor, regedit.exe

Open the following subkey:

\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeES\Parameters

Add the following DWORD value:

Logging Level

On the Edit menu, click DWORD, type 5, and then click OK. (You can also double-click on Logging Level to edit the value.).

Note that there is a Microsoft Knowledge Base article Configuring the Diagnostics Setting for the Events Service available. For more information, please take a look at The Secrets of Exchange Server Scripting and Routing, Useful Links.

The Microsoft Exchange Event Service agent log is a hidden message, which is stored in that folder which hosts the Scripting and Routing script. Per default this log can have a maximum size of 32 Kbyte. If this value is reached, the agent log will be overwritten. The Event Service does have a registry entry that controls the size of the agent log. You can edit the registry entry to change this size. Note that this is not officially supported by Microsoft.

To change the entry, perform the following steps:

Start the registry editor, regedit.exe

Open the following subkey:

\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeES\Parameters

Change the following DWORD value:

Maximum size for agent log in KB

Change the decimal value to the number of Kbytes that you want to have stored at the agent log.

The Microsoft Exchange Event Service runs an Exchange Scripting and Routing script only for a limited time. If this time is too short to finish the script, processing will be timed out and an error message is logged in the Windows NT EventLog. Per default this timeout is 900 seconds. The Event Service has a registry key that controls this timeout. You can edit the registry entry to change this timeout. Note that this is not officially supported from Microsoft.

To change the entry, perform the following steps:

Start the registry editor, regedit.exe

Open the following subkey:

\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeES\Parameters

Change the following DWORD value:

Maximum execution time for scripts in seconds

Change the decimal value to the number of seconds that you want to have the event service should wait before the timeout does occur.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it.

Windows NT EventLog Error Messages

If you are not familiar with the programming of Exchange Server Scripting and Routing scripts, it is possible that you get some wired errors in the Windows NT EventLog. However, these error messages are sometimes not very easy to understand. The following list should give you a starting point to identify the most common errors and their messages in the Microsoft Windows NT EventLog.

Error Description
Event-ID: 20
Source: MSExchangeES
Type: Error
Category: General
Description:
Could not find a connection point for the event that has been triggered
One of the used Scripting Agent script events is misspelled in your Microsoft Exchange Server Scripting and Routing script.

Check the Scripting Agent script events in your Microsoft Exchange Server Scripting and Routing script to resolve this problem.

Event-ID: 11
Source: MSExchangeES
Type: Error
Category: General
Description:
A fatal error (0x80040111) occurred in an IExchangeEventSink while processing message [subject = "<The subject of the message>"]
The mailbox, which has been used to edit the Microsoft Exchange Server Scripting and Routing script, is not visible in the Global Address List. Do not hide this mailbox from the Global Address List, otherwise the Microsoft Exchange Server Scripting and Routing script will fail to run.

Make the mailbox visible in the Global Address List and reboot the Microsoft Exchange Server machine to resolve this problem.

Also check the Windows NT account, which has been used to access the Microsoft Exchange Server mailbox. It  does not have the appropriate permission to logon-on and/or open the folder in question.

Event-ID: 5
Source: MSExchangeES
Type: Error
Category: General
Description:
A unexpected MAPI error occurred. Error returned was [0x8004010f]
If you receive this error the Microsoft Exchange Event Service may have encountered a major problem. Try to stop and restart the service. If this is not possible, shutdown and restart the Microsoft Exchange server.

It is also possible that your event script becomes corrupt under some circumstances. If the reboot does not resolve the problem, reinstall the event script.

Event-ID: 5
Source: MSExchangeES
Type: Error
Category: General
Description:
A unexpected MAPI error occurred. Error returned was [0x80004005]

 

or Description:
A unexpected MAPI error occurred. Error returned was [0x8040107]

If you receive this error the Microsoft Exchange Event Service may have encountered a major problem. The only supported workaround seems to remove and re-add the Microsoft Exchange Event Service service.


 



Before removing the Microsoft Exchange Event Service as a solution, verify that this server is a public folder server. If the Microsoft Exchange server is not a public folder server, the Microsoft Exchange Events Service will not start.

Note that a complete list of MAPI error codes can be found at the Microsoft Developer Network Online, or at Digging depper into CDO, Error Codes.