What is transport agent and how to change it with PowerShell?

Microsoft Exchange server allows to access the message transport pipeline with transport agents. They are small programs that have a direct access to messages processed by the transport service of Exchange.

This is especially useful when you need to e.g. scan contents of incoming emails for spam, detect viruses or trigger any other action with the information found in the message.

MSH Software Exchange Autoresponder also works utilizing the transport agent. When the message contains a specific keyword or is sent from, or to the specific email address it performs an action and sends a reply.

To check the list of currently installed agents on your Exchange server run the following command in the PowerShell console:

Get-TransportAgent

The resulting list shows three columns:

  • Identity - name of the transport agent,
  • Enabled - the state of the agent. True means that the agent is turned on,
  • Priority - the order in which the message is checked by transport agents. When the agent is set to priority 1 it means it will process the message first.

PowerShell (PS) console also allows to change various settings od these agents, most commonly to disable or enable them, or change their priority.

To disable specific agent, e.g. MSH Exchange Autoresponder you need to run the following command in PS:

Disable-TransportAgent -Identity "MSH Exchange Autoresponder"

Enabling the agent is very similar:

Enable-TransportAgent -Identity "MSH Exchange Autoresponder"

To change its priority run the command:

Set-TransportAgent -identity "MSH Exchange Autoresponder" -priority 1

Note that all other agents will automatically change their priority to match the new situation. In the above case, the priority of the rest of available agents will be changed up by one position.

Instead of the PowerShell console you can use the graphical interface of MSH Exchange Autoresponder. It’s much easier and allows performing described actions with just a couple of clicks:

To learn more visit MSH Exchange Autoresponder website.

Lukasz is a software developer and owner of MSH Software company which builds email processing tools for Microsoft Exchange, Zimbra Collaboration Suite and Postfix. He specializes in server, desktop and web applications written in Java, .NET and C++.