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.
What do you need to know before you begin?
- 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
- 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't use the Exchange admin center (EAC) to perform this
procedure. You can only use the Shell.
- For information about keyboard shortcuts that may apply to the
procedures in this topic, see Keyboard Shortcuts in
the Exchange Admin Center.
Use the Shell to configure anti-spam agent logging
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
- Sets the maximum size of an agent log file to 20 MB.
- Sets the maximum size of the agent log directory to
- 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
For detailed syntax and parameter information, see the AgentLog parameters in Set-TransportService.
How do you know this worked?
To verify that you have successfully configured anti-spam agent logging, do the following:
- In the Shell, run the following command:
Get-TransportService <ServerIdentity> | Format-List AgentLog*
- Verify the values displayed are the values you configured.