Get-AgentLog

 

Applies to: Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3

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.

Syntax

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

Detailed Description

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.

Parameters

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".

Return Types

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

Example

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"