Commands › Exchange Online

Export-MailboxDiagnosticLogs

Exchange Online ExchangeOnlineManagement Export-*

Export diagnostic data from user and system mailboxes in your organization.

Quick start script

# Export-MailboxDiagnosticLogs — 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
Export-MailboxDiagnosticLogs -Identity <GeneralMailboxIdParameter> -ComponentName <String> -ExtendedProperties <SwitchParameter> | Format-List

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

Syntax — 2 parameter sets

MailboxLog

Export-MailboxDiagnosticLogs [-Identity] <GeneralMailboxIdParameter> -ComponentName <String>
 [-Archive]
 [-Confirm]
 [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-IncludeInactiveMailboxes]
 [-ReadFromDomainController]
 [-ResultSize <Unlimited>]
 [-WhatIf]
 [<CommonParameters>]

ExtendedProperties

Export-MailboxDiagnosticLogs [-Identity] <GeneralMailboxIdParameter>
 [-ExtendedProperties]
 [-Archive]
 [-Confirm]
 [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-IncludeInactiveMailboxes]
 [-ReadFromDomainController]
 [-ResultSize <Unlimited>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (11)

ParameterTypeRequiredWhat it controls
-Identity GeneralMailboxIdParameter yes The Identity parameter specifies that mailbox that contains the diagnostics logs that you want to view. You can use any value that uniquely identifies the mailbox. For example:
-ComponentName String yes The ComponentName parameter specifies the component that you want to retrieve the diagnostic logs for. Valid values depend on the type and location of the mailbox (on-premises Exchange or Exchange Online). Valid...
-ExtendedProperties SwitchParameter yes The ExtendedProperties switch specifies whether to retrieve all of the well-known properties from the mailbox table that are useful for troubleshooting. You don't need to specify a value with this switch.
-Archive SwitchParameter This parameter is available only in on-premises Exchange.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-Credential PSCredential This parameter is available only in on-premises Exchange.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-IncludeInactiveMailboxes SwitchParameter This parameter is available only in the cloud-based service.
-ReadFromDomainController SwitchParameter This parameter is available only in on-premises Exchange.
-ResultSize Unlimited The ResultSize parameter specifies the maximum number of results to return. If you want to return all requests that match the query, use unlimited for the value of this parameter. The default value is 1000.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

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