Partager via


Edge Transport Logging Sample Agent

The Edge Tranport Loging 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.

To download this sample, download the Exchange 2010 Transport Agents SDK from the Microsoft Download Center.

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 Exchange Server 2010 Transport Agents 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 .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 Exchange Server 2010 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 2010 installation directory.

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