Click to Rate and Give Feedback
TechNet
TechNet Library
Exchange Server
Technical Reference
Transport Cmdlets
Anti-Spam Cmdlets
 Get-AgentLog
Exchange 2007
Get-AgentLog

Applies to: Exchange Server 2007 SP1 Topic Last Modified: 2007-06-28

Use the Get-AgentLog cmdlet to parse log files that you specify as parameters and collect raw statistics from the filtering that anti-spam agents apply during a time period that you specify.


Get-AgentLog [-EndDate <DateTime>] [-Location <LocalLongFullPath>] [-StartDate <DateTime>]

Parameter Required Type Description

EndDate

Optional

System.DateTime

This parameter specifies the date and time that you want to stop collecting statistics. The default time is the current time. When you enter a specific date, use the short date format that is defined in the Regional Options settings that are configured on the local computer. For example, if your computer is configured to use the short date format mm/dd/yyyy, enter 03/01/2006 to specify March 1, 2006. You can enter the date only, for example, 10/05/2005. Or you can enter the date and time of day. If you enter a time of day and date, you must enclose the argument in double quotation marks, for example, "10/05/2005 5:00:00 PM".

Location

Optional

Microsoft.Exchange.Data.LocalLongFullPath

The Location parameter specifies the directory that contains the log files that you can use to build usage reports. The default path is C:\Program Files\Microsoft\Exchange Server\TransportRoles\Logs\AgentLog. You must enter the file path in double quotation marks, for example, "C:\Program Files\Microsoft\Exchange Server\TransportRoles\Logs\AgentLog".

StartDate

Optional

System.DateTime

The StartDate parameter specifies the date and time that the collection of statistics starts. The default time is the current time. When you enter a specific date, use the short date format that is defined in the Regional Options settings that are configured on the local computer. For example, if your computer is configured to use the short date format mm/dd/yyyy, enter 03/01/2006 to specify March 1, 2006. You can enter the date only, for example, 10/05/2005, or you can enter the date and time of day. If you enter a time of day and date, you must enclose the argument in double quotation marks, for example, "10/05/2005 5:00:00 PM".

To run the Get-AgentLog cmdlet, the account you use must be delegated the following:

  • Membership in the local Administrator group

For more information about permissions, delegating roles, and the rights that are required to administer Microsoft Exchange Server 2007, see Permission Considerations.

Object Description

Timestamp

Time of the log entry

ConnectorName

CN of the connector that received the message

SessionId

The SMTP session IP address

IPAddress

The IP address of the connecting server.

MessageId

The Microsoft Exchange Server 2007 message ID

P1FromAddress

The P1 (message envelope) From: message header field

P2FromAddresses

The P2 (message header) From: message header field

Recipients

The message recipients

Agent

Name of the agent that invokes the action

Event

The event on which the action was taken

Action

The action taken (Integer)

SmtpResponse

Response that is sent to caller, if any

Reason

Reason code that is supplied by agent

ReasonData

Detailed description by the agent

The following code example returns a report that has statistics that are collected from 5:00 P.M., October 5, 2005 until the current time.

Get-AgentLog -StartDate "10/05/2005 5:00:00 PM"
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Exchange Server 2007: Managing and Filtering Anti-Spam Agent Logs      Bharat Suneja ... Stanley Roark   |   Edit   |  
More details about anti-spam agent logs and how to manage and filter them can be found in the following post:
http://exchangepedia.com/blog/2007/04/managing-and-filtering-anti-spam-agent.html
Quick antispam report or status check?      Bharat Suneja   |   Edit   |  
Here's a cmdlet to quickly determine how the antispam agents are doing:
Get-AgentLog -StartDate "6/16/2008" | group action | ft name,count -Autosize

More in this blog post:
http://exchangepedia.com/blog/2008/06/quick-antispam-report-or-status-check.html
Keeping tabs on antispam filters: A few handy scripts in Exchange Server 2007      Bharat Suneja ... Stanley Roark   |   Edit   |  
Exchange Server 2007 includes some scripts to report on activity of its antispam agents. More details in the following post:
http://exchangepedia.com/blog/2007/12/keeping-tabs-on-antispam-filters-few.html
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker