/compare/exchange-online/get-exomailbox-vs-get-mailbox
Get-EXOMailbox vs Get-Mailbox in Exchange Online PowerShell
- tool
- Exchange Online PowerShell
- compares
- Get-EXOMailbox vs Get-Mailbox
Use Get-EXOMailbox for bulk reads in scripts (thousands of mailboxes): it ships inside the ExchangeOnlineManagement module, returns only the properties you ask for and is optimized for speed. Use Get-Mailbox when you need a property or parameter that Get-EXOMailbox does not have, or for one-off interactive checks. Both need Connect-ExchangeOnline before they return data.
| Criterion | Get-EXOMailbox | Get-Mailbox |
|---|---|---|
| Comes from | The module itself (one of nine Get-EXO* cmdlets) | Generated by Connect-ExchangeOnline (REST API cmdlet) |
| Before connecting | Exists; fails with "You must call Connect-ExchangeOnline..." | Does not exist: "The term 'Get-Mailbox' is not recognized" |
| Properties returned | Minimum property set by default; add -PropertySets and/or -Properties | All properties (Microsoft cites at least 230 per mailbox) |
| Default result size | 1000 (-ResultSize Unlimited for all) | 1000 (-ResultSize Unlimited for all) |
| Speed on large tenants | High (Microsoft rates it "high performance") | Medium |
| Parameters and properties | Limited set | All parameters and output properties |
Property sets
Get-EXOMailbox -PropertySets accepts these values in module 3.10.1 (read from the parameter type, offline):
Import-Module ExchangeOnlineManagement
$t = (Get-Command Get-EXOMailbox).Parameters['PropertySets'].ParameterType.GetElementType()
[enum]::GetNames($t) -join ', '
Get-Command -Module ExchangeOnlineManagement -Name 'Get-EXO*' | Measure-Object | Select-Object -ExpandProperty CountOutput
All, Minimum, AddressList, Archive, Audit, Custom, Delivery, Hold, Moderation, Move, Policy, PublicFolder, Quota, Resource, Retention, SCL, SoftDelete, StatisticsSeed 9
The second line is the number of Get-EXO* cmdlets in the module (nine). The properties in each set are listed in Microsoft's "Property sets in Exchange Online PowerShell module cmdlets" article.
Equivalent commands
# Every mailbox, minimum properties, fast
Get-EXOMailbox -ResultSize Unlimited
# Add quota and archive properties
Get-EXOMailbox -ResultSize Unlimited -PropertySets Quota,Archive
# Specific properties only (plus the minimum set)
Get-EXOMailbox -ResultSize Unlimited -Properties ForwardingSmtpAddress,DeliverToMailboxAndForward
# The same data with the older cmdlet (all properties)
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName,ForwardingSmtpAddress,DeliverToMailboxAndForwardIf you use -PropertySets or -Properties, the output contains the requested properties and the minimum set. Avoid -PropertySets All: Microsoft discourages it because it removes the speed advantage.
Other Get-EXO cmdlets
| Get-EXO cmdlet | Older equivalent |
|---|---|
| Get-EXORecipient | Get-Recipient |
| Get-EXOCasMailbox | Get-CASMailbox |
| Get-EXOMailboxPermission | Get-MailboxPermission |
| Get-EXORecipientPermission | Get-RecipientPermission |
| Get-EXOMailboxStatistics | Get-MailboxStatistics |
| Get-EXOMailboxFolderStatistics | Get-MailboxFolderStatistics |
| Get-EXOMailboxFolderPermission | Get-MailboxFolderPermission |
| Get-EXOMobileDeviceStatistics | Get-MobileDeviceStatistics |