Programming Microsoft Outlook and Microsoft Exchange, Second Edition (DV-MPS Programming)
Before starting to work with the Event Service and writing agents, you first must install the service and get it running correctly in your environment. By default, the Event Service is installed when you install Exchange Server 5.5. However, if you are upgrading from a previous version of Exchange Server, you will need to add the Event Service during installation.
By default, the Event Service logs on using the credentials of the Exchange Service Account. While this account has permission to access many of the items stored in the Exchange server, it has very limited Windows NT permissions. You might want to change the Windows NT account under which the Event Service runs to change the access this account has and to audit the account. To change the account, change the Log On As settings in the Services applet of the Control Panel for the Microsoft Exchange Event Service, as shown in Figure 13-2.
If you do change the Windows NT account for the Event Service, make sure that the account you specify for the Event Service truly does have the Log On As A Service permission set in the User Manager For Domains. Also, make sure the account has the proper Exchange permissions so that it can access any of the mailboxes or public folders where scripts will be installed. By default, the Event Service passes a logged-on MAPI session to the Event Scripting Agent, so you do not have to write the logon code in the script. But the Event Service will try to log on to resources using the Windows NT account you specify for the service. If this Windows NT account does not have the proper permissions, your scripting agent will not work. You can set the permissions (such as Mailbox Owner and Send As permissions) for all necessary resources in the Exchange Administrator program.
Figure 13-2. You change the Windows NT account that the Event Service runs under by using the Service applet in the Control Panel.
In addition to setting up the Windows NT account that the Event Service will run under, you must also give users permission to create agents. This is a two-step process. First, you must give users permission to create and bind agents in the system. This is accomplished by setting their permissions for a system folder named EventConfig_servername, which is shown in Figure 13-3.
Figure 13-3. The EventConfig_servername folder is found under the Events Root system folder. You must set user permissions for this folder if you want users to write agents.
Locate this folder in your Exchange Administrator program, and select Properties from the File menu. Click the Client Permissions button, and in the Client Permissions dialog box shown in Figure 13-4, add users or distribution lists and assign them Author or higher permissions.
After you have assigned the proper permissions for the EventConfig_servername folder, the second step of the process is to configure the folder. To do this, start Outlook, right-click on a public folder or an Exchange Server folder, and select Properties. On the Agents tab, as shown in Figure 13-5, you can create, change, disable, or delete agents in your folder. For the Agents tab to appear, you must be the owner of the folder and the Server Scripting add-in must be installed. By default, Outlook does not install the Server Scripting add-in. To install the Server Scripting add-in, select Options from the Tools menu, click on the Other tab, click Advanced Options, and then click Add-In Manager. Check the Server Scripting check box to add the Agents tab to the folders where you have permissions to create agents.
Figure 13-4. In the Client Permissions dialog box, you assign users or distribution lists permissions to write agents. You must assign Author or higher permissions to these users before they can create agents.
Figure 13-5. The Agents tab for the Expense Reports public folder. You must have appropriate EventConfig_servername permissions, be an owner of the folder, and have the Server Scripting add-in installed to see the Agents tab in Outlook.