Export (0) Print
Expand All

Configure Anti-Spam Agent Logging

 

Applies to: Exchange Server 2013

Topic Last Modified: 2012-10-03

Agent logging records the actions performed by specific Exchange anti-spam agents. The information written to the agent log depends on the agent, the SMTP event, and the action performed on the message.

  • Estimated time to complete: 15 minutes
  • You need to be assigned permissions before you can perform this procedure or procedures. To see what permissions you need, see the "Transport Service" and "Edge Transport server" entries in the Mail Flow Permissions topic.
  • By default, anti-spam features aren't enabled in the Transport service on a Mailbox server. Typically, you only enable the anti-spam features on a Mailbox server if your Exchange organization doesn't do any prior anti-spam filtering before accepting incoming messages. For more information, see Enable Anti-Spam Functionality on a Mailbox Server.
  • You can only use the Shell to perform this procedure.
  • For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard Shortcuts in the Exchange Admin Center.
tipTip:
Having problems? Ask for help in the Exchange forums. Visit the forums at: Exchange Server, Exchange Online, or Exchange Online Protection

Run the following command:

Set-TransportService <ServerIdentity> -AgentLogEnabled <$true | $false> -AgentLogMaxAge <dd.hh:mm:ss> -AgentLogMaxDirectorySize <Size> -AgentLogMaxFileSize <Size> -AgentLogPath <LocalFilePath>

This example sets the following agent log settings on the Mailbox server named Mailbox01:

  • Sets the location of the agent log files to D:\Anti-Spam Agent Log. Note that if the folder doesn't exist, it will be created for you.
  • Sets the maximum size of an agent log file to 20 MB.
  • Sets the maximum size of the agent log directory to 400 MB.
  • Sets the maximum age of an agent log file to 14 days.
Set-TransportService Mailbox01 -AgentLogPath "D:\Anti-Spam Agent Log" -AgentLogMaxFileSize 20MB -AgentLogMaxDirectorySize 400MB -AgentLogMaxAge 14.00:00:00
noteNote:
  • If you set the AgentLogPath parameter to the value $null, you effectively disable agent logging. However, if you set AgentLogPath to $null when the value of the AgentLogEnabled parameter is $true, event log errors are generated. The preferred method to disable agent logging is to set AgentLogEnabled to $false.
  • Setting the AgentLogMaxAge parameter to the value 00:00:00 prevents the automatic removal of agent log files because of their age.

For detailed syntax and parameter information, see the AgentLog parameters in Set-TransportService.

To verify that you have successfully configured anti-spam agent logging, do the following:

  1. In the Shell, run the following command:
    Get-TransportService <ServerIdentity> | Format-List AgentLog*
    
  2. Verify the values displayed are the values you configured.
 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft