Skip to content

/compare/exchange-online/get-exomailbox-vs-get-mailbox

Get-EXOMailbox vs Get-Mailbox in Exchange Online PowerShell

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated
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.

CriterionGet-EXOMailboxGet-Mailbox
Comes fromThe module itself (one of nine Get-EXO* cmdlets)Generated by Connect-ExchangeOnline (REST API cmdlet)
Before connectingExists; fails with "You must call Connect-ExchangeOnline..."Does not exist: "The term 'Get-Mailbox' is not recognized"
Properties returnedMinimum property set by default; add -PropertySets and/or -PropertiesAll properties (Microsoft cites at least 230 per mailbox)
Default result size1000 (-ResultSize Unlimited for all)1000 (-ResultSize Unlimited for all)
Speed on large tenantsHigh (Microsoft rates it "high performance")Medium
Parameters and propertiesLimited setAll parameters and output properties

Property sets

Get-EXOMailbox -PropertySets accepts these values in module 3.10.1 (read from the parameter type, offline):

powershell
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 Count

Output

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

powershell
# 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,DeliverToMailboxAndForward

If 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 cmdletOlder equivalent
Get-EXORecipientGet-Recipient
Get-EXOCasMailboxGet-CASMailbox
Get-EXOMailboxPermissionGet-MailboxPermission
Get-EXORecipientPermissionGet-RecipientPermission
Get-EXOMailboxStatisticsGet-MailboxStatistics
Get-EXOMailboxFolderStatisticsGet-MailboxFolderStatistics
Get-EXOMailboxFolderPermissionGet-MailboxFolderPermission
Get-EXOMobileDeviceStatisticsGet-MobileDeviceStatistics

Sources