Quick answer: Export-MailboxDiagnosticLogs returns diagnostic logs that Exchange keeps inside a mailbox. Run it with -ComponentName to read one component's log, such as MRM, RBA or CalendarPermissions, or with -ExtendedProperties to dump the mailbox's troubleshooting properties. It works in Exchange Online and in Exchange Server 2010 through Exchange Server SE. The log text sits in the MailboxLog property of the result.
Export-MailboxDiagnosticLogs -Identity adele.vance@contoso.com -ComponentName MRM
What the cmdlet does
Several Exchange background processes write a short log into the mailbox they work on. The Managed Folder Assistant records retention runs. The Resource Booking Assistant records why a room accepted or declined a meeting. Calendar sharing and out-of-office rules keep their own logs too.
Export-MailboxDiagnosticLogs reads those logs back. It doesn't change anything in the mailbox, so it's safe to run against production mailboxes while you troubleshoot.
Syntax
The cmdlet has 2 parameter sets. You pick one by using either -ComponentName or -ExtendedProperties.
# MailboxLog: read one component's log
Export-MailboxDiagnosticLogs
[-Identity] <GeneralMailboxIdParameter>
-ComponentName <String>
[-Archive]
[-Confirm]
[-Credential <PSCredential>]
[-DomainController <Fqdn>]
[-IncludeInactiveMailboxes]
[-ReadFromDomainController]
[-ResultSize <Unlimited>]
[-WhatIf]
[<CommonParameters>]
# ExtendedProperties: dump the mailbox's troubleshooting properties
Export-MailboxDiagnosticLogs
[-Identity] <GeneralMailboxIdParameter>
[-ExtendedProperties]
[-Archive]
[-Confirm]
[-Credential <PSCredential>]
[-DomainController <Fqdn>]
[-IncludeInactiveMailboxes]
[-ReadFromDomainController]
[-ResultSize <Unlimited>]
[-WhatIf]
[<CommonParameters>]
Parameters
| Parameter | Where it works | What it does |
|---|---|---|
-Identity |
Online and on-premises | The mailbox to read. Any unique value works: name, alias, email address, UPN, GUID, DN, Domain\Username and so on. Position 1, so you can leave out the parameter name. |
-ComponentName |
Online and on-premises | The component whose log you want. See the list below. |
-ExtendedProperties |
Online and on-premises | Returns the well-known troubleshooting properties from the mailbox table. Takes no value. |
-ResultSize |
Online and on-premises | The most results to return. The default is 1000. Use unlimited for all of them. |
-IncludeInactiveMailboxes |
Exchange Online only | Includes inactive mailboxes, meaning mailboxes that were on Litigation Hold or In-Place Hold when they were soft-deleted. |
-Archive |
On-premises only | Reads the logs of the archive mailbox instead of the primary mailbox. |
-Credential |
On-premises only | Runs the command as another account, for example -Credential (Get-Credential). |
-DomainController |
On-premises only | The domain controller to read from, by FQDN, such as dc01.contoso.com. |
-ReadFromDomainController |
On-premises only | Reads from a domain controller in the user's domain. Use it after Set-AdServerSettings -ViewEntireForest $true. |
ComponentName values
Microsoft Learn lists these values. Which ones return data depends on the mailbox type and on whether the mailbox is in Exchange Online or on-premises.
| Value | What it logs |
|---|---|
MRM |
Messaging records management: retention tags and policies applied by the Managed Folder Assistant |
RBA |
The Resource Booking Assistant, which processes meeting requests sent to room and equipment mailboxes |
CalendarPermissions |
Changes to calendar folder permissions |
CalendarSharingInvite, AcceptCalendarSharingInvite, CalendarSharingLocalFolder, InternalCalendarSharingMigration |
Calendar sharing invitations and the move to the newer sharing model |
Sharing, SharingMigrationAssistant, SharingSyncAssistant |
Folder sharing and sharing sync |
FreeBusyPublishingAssistantQuickLog |
Free/busy publishing |
InternetCalendar |
Subscribed internet calendars |
OnlineMeetings |
Online meeting details added to calendar items |
RemindersAssistant, BirthdayAssistant |
Reminders and birthday calendar items |
OOFRules |
Out-of-office rules |
SweepRules |
Sweep rules created in Outlook on the web |
HoldTracking, SubstrateHoldTracking |
Hold changes on the mailbox |
ActionProcessingAgent, DefaultViewIndexer, TimeProfile |
Other mailbox assistants |
The descriptions in the second column are our summaries of what each component covers. Learn only lists the names.
Examples
1. Read the MRM log for a mailbox
Export-MailboxDiagnosticLogs -Identity adele.vance@contoso.com -ComponentName MRM |
Select-Object -ExpandProperty MailboxLog
The result object holds the log in MailboxLog. Expanding it prints the raw text, which is easier to read than the default table view.
2. Check when the Managed Folder Assistant last ran
$props = Export-MailboxDiagnosticLogs -Identity adele.vance@contoso.com -ExtendedProperties
$xml = [xml]$props.MailboxLog
$xml.Properties.MailboxTable.Property |
Where-Object { $_.Name -like 'ELC*' } |
Select-Object Name, Value
-ExtendedProperties returns XML. The properties that start with ELC belong to the Managed Folder Assistant, and ELCLastSuccessTimestamp shows its last successful run. If that date is old, run Start-ManagedFolderAssistant -Identity adele.vance@contoso.com and check again later. The assistant doesn't finish instantly.
3. Find out why a room declined a meeting
Export-MailboxDiagnosticLogs -Identity 'Conference Room 4B' -ComponentName RBA |
Select-Object -ExpandProperty MailboxLog
The RBA log shows each meeting request the Resource Booking Assistant handled and what it decided. Compare it with the room's booking rules from Get-CalendarProcessing. Common causes are a conflict, a meeting longer than MaximumDurationInMinutes, or a booking window that's too short.
4. See who changed calendar permissions
Export-MailboxDiagnosticLogs -Identity "Yuuto Sasaki" -ComponentName CalendarPermissions
This is one of the 2 examples on Microsoft Learn. Use it when a delegate suddenly can't see or edit a calendar.
5. Troubleshoot out-of-office replies
Export-MailboxDiagnosticLogs -Identity adele.vance@contoso.com -ComponentName OOFRules |
Select-Object -ExpandProperty MailboxLog
Check the reply settings themselves with Get-MailboxAutoReplyConfiguration. Learn's own example uses -ComponentName OOF and notes it applies to Exchange 2010 and 2013. In current versions the listed value is OOFRules.
6. Read an inactive mailbox in Exchange Online
Export-MailboxDiagnosticLogs -Identity megan.bowen@contoso.com -ComponentName HoldTracking -IncludeInactiveMailboxes
7. Read an archive mailbox on-premises
Export-MailboxDiagnosticLogs -Identity adele.vance@contoso.com -ComponentName MRM -Archive
-Archive is only available in on-premises Exchange.
8. Save a log to a file
Export-MailboxDiagnosticLogs -Identity 'Conference Room 4B' -ComponentName RBA |
Select-Object -ExpandProperty MailboxLog |
Out-File -FilePath .\room-4b-rba.txt
A text file is easier to search and to attach to a support case.
Permissions
You need to be assigned permissions before you can run the cmdlet, and some parameters may not be available if your role doesn't include them. Microsoft's article on finding the permissions required to run any Exchange cmdlet shows how to look up the role for your environment.
Troubleshooting
The log comes back empty. That component hasn't written anything for this mailbox yet, or it doesn't apply to this mailbox type. An RBA log only exists for resource mailboxes.
The output is cut off. PowerShell is formatting it as a table. Pipe to Select-Object -ExpandProperty MailboxLog or Format-List.
"A parameter cannot be found that matches parameter name 'Archive'." You're connected to Exchange Online. -Archive, -Credential, -DomainController and -ReadFromDomainController only work on-premises.
The term isn't recognized. You aren't connected to Exchange. Run Connect-ExchangeOnline first, or open the Exchange Management Shell on-premises.
-ComponentName OOF returns nothing. Use OOFRules. OOF is the older value from Exchange 2010 and 2013.
FAQ
Does Export-MailboxDiagnosticLogs work in Exchange Online?
Yes. Learn lists it for Exchange Online and for Exchange Server 2010, 2013, 2016, 2019 and SE. A few parameters are limited to one environment, as shown in the table above.
Can I use -ComponentName and -ExtendedProperties together?
No. They belong to different parameter sets. Run the cmdlet twice if you need both.
Does it change the mailbox?
No. It only reads logs and properties.
What other cmdlets help with calendar problems?
Get-CalendarDiagnosticObjects shows the history of a single meeting, and Get-CalendarDiagnosticLog covers the same logs in on-premises Exchange. For mailbox size and retention questions, use Get-MailboxFolderStatistics and Get-RecoverableItems.