Share via


Edge Transport Logging Sample Agent

Topic Last Modified: 2007-06-18

This sample shows you how to create an agent that responds to the OnEndOfData protocol event, and asynchronously logs the message to a file on the local hard disk.

Structure of the Sample

The Edge Transport Logging sample agent consists of a simple Visual Studio .NET 2005 C# project. By default, the files are installed in the directory in which the Microsoft Exchange Server 2007 Software Development Kit (SDK) is installed, in the \Samples\EdgeTransportLogging folder.

The following are the primary files for the sample:

  • Install.ps1   An Exchange Management Shell script that is used to install the compiled sample.
  • **Uninstall.ps1 **  An Exchange Management Shell script that is used to uninstall the compiled sample.
  • EdgeTransportLogging.csproj   The Visual Studio C# project file.
  • **EdgeTransportLogging.cs **  The C# source code for the sample.

Building the Sample

To build the Edge Transport Logging sample agent, you must first install Visual Studio .NET 2005 and the Microsoft .NET Framework version 2.0 on the Edge Transport server.

After you install the required software, open the C# project by using Visual Studio. If it is necessary, update the references to the Microsoft.Exchange.Data.* namespaces. Build the project and fix any errors you encounter.

Installing the Sample

To install the Edge Transport Logging sample agent

  1. Edit the install.ps1 script to make sure that the $EXDIR variable is correctly initialized for your system. The value of the $EXDIR variable should be the path of the Microsoft Exchange Server 2007 installation directory.

  2. Open the Exchange Management Shell and run the install.ps1 script.

  3. Exit the Exchange Management Shell.

Uninstalling the Sample

To uninstall the Edge Transport Logging sample agent

  1. Edit the uninstall.ps1 script to make sure that the $EXDIR variable is correctly initialized for your system. The value of the $EXDIR variable should be the path of the Exchange Server 2007 installation directory.

  2. Open the Exchange Management Shell and run the uninstall.ps1 script.