Commands › Exchange Online

Get-AgentLog

Exchange Online ExchangeOnlineManagement Get-*

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.

Quick start script

# Get-AgentLog — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Get-AgentLog | Format-List

# 3. Export for evidence / drift tracking
Get-AgentLog | Export-Clixml .\AgentLog-$(Get-Date -Format yyyyMMdd).xml

Syntax

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

Parameters (4)

ParameterTypeRequiredWhat it controls
-EndDate DateTime The EndDate parameter specifies the end date of the date range.
-Location LocalLongFullPath 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...
-StartDate DateTime The StartDate parameter specifies the start date of the date range.
-TransportService TransportService The TransportService parameter specifies the transport service that you want to view or modify. Valid values for this parameter are:

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.