Muokkaa

Jaa


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.

Syntax

Get-AgentLog
   [-EndDate <DateTime>]
   [-Location <LocalLongFullPath>]
   [-StartDate <DateTime>]
   [-TransportService <TransportService>]
   [<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.

Examples

Example 1

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

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

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/2018 to specify September 1, 2018. 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/2018 5:00 PM".

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

-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
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019

-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/2018 to specify September 1, 2018. 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/2018 5:00 PM".

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

-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:TransportService
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Exchange Server 2013, Exchange Server 2016, Exchange Server 2019

Inputs

Input types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn't accept input data.

Outputs

Output types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn't return data.