Get-AgentLog

This cmdlet is available only in on-premises Exchange. 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. For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax (https://technet.microsoft.com/library/bb123552.aspx).

Syntax

Get-AgentLog
   [-EndDate <DateTime>]
   [-Location <LocalLongFullPath>]
   [-StartDate <DateTime>]
   [-TransportService <Hub | Edge | FrontEnd | MailboxSubmission | MailboxDelivery>]
   [<CommonParameters>]

Description

You need to be assigned permissions before you can run this cmdlet. Although this topic lists all parameters for the cmdlet, you may not have access to some parameters if they're not included in the permissions assigned to you. To find the permissions required to run any cmdlet or parameter in your organization, see Find the permissions required to run any Exchange cmdlet (https://technet.microsoft.com/library/mt432940.aspx).

Examples

-------------------------- Example 1 --------------------------

Get-AgentLog -StartDate "01/04/2015 9:00:00 AM" -EndDate "01/08/2015 6:00:00 PM" -TransportService FrontEnd

This example returns a report that has statistics collected between 09:00 (9 A.M.), January 4, 2015 and 18:00 (6 P.M.), January 8, 2015 in the Front End Transport service.

Optional Parameters

-EndDate

The EndDate parameter specifies the end date of the date range.

Use the short date format that's defined in the Regional Options settings on the computer where you're running the command. For example, if the computer is configured to use the short date format mm/dd/yyyy, enter 09/01/2015 to specify September 1, 2015. You can enter the date only, or you can enter the date and time of day. If you enter the date and time of day, enclose the value in quotation marks ("), for example, "09/01/2015 5:00 PM".

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016
-Location

The Location parameter specifies the directory that contains the log files that you can use to build usage reports. The default path is %ExchangeInstallPath%TransportRoles\Logs\AgentLog. You need to enclose the file path in quotation marks (").

Type:LocalLongFullPath
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016
-StartDate

The StartDate parameter specifies the start date of the date range.

Use the short date format that's defined in the Regional Options settings on the computer where you're running the command. For example, if the computer is configured to use the short date format mm/dd/yyyy, enter 09/01/2015 to specify September 1, 2015. You can enter the date only, or you can enter the date and time of day. If you enter the date and time of day, enclose the value in quotation marks ("), for example, "09/01/2015 5:00 PM".

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016
-TransportService

The TransportService parameter specifies the transport service that you want to view or modify. Valid values for this parameter are:

  • Hub for the Transport service on Mailbox servers.

  • MailboxSubmission for the Mailbox Transport Submission service on Mailbox servers.

  • MailboxDelivery for the Mailbox Transport Delivery service on Mailbox servers.

  • FrontEnd for the Front End Transport service on Mailbox servers.

  • Edge on Edge Transport servers.

Type:Hub | Edge | FrontEnd | MailboxSubmission | MailboxDelivery
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2013, Exchange Server 2016

Inputs

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types (https://go.microsoft.com/fwlink/p/?LinkId=616387). If the Input Type field for a cmdlet is blank, the cmdlet doesn't accept input data.

Outputs

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types (https://go.microsoft.com/fwlink/p/?LinkId=616387). If the Output Type field is blank, the cmdlet doesn't return data.