Mailbox inventory
Documentation: Microsoft Learn
Get-EXOMailbox with -ResultSize Unlimited pages through all recipients rather than stopping at the default first thousand.
The script
Script reader
Inspect before you run
Inspect the script below. It does not run in this browser.
Inspection only — no command has run.
Show reference output
Inspect this example’s structure
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-EXOMailbox -ResultSize Unlimited | Select-Object DisplayName,PrimarySmtpAddress,RecipientTypeDetails,UserPrincipalName- Stage 1Get-EXOMailbox
-ResultSize - Stage 2Select-Object
Positional values or no named parameters
How it works
Get-EXOMailbox with -ResultSize Unlimited pages through all recipients rather than stopping at the default first thousand. The projection keeps display name and primary address with RecipientTypeDetails, which is the field distinguishing a shared mailbox from a regular one, plus the UPN for joining against directory data.
Adapting it
Pass -RecipientTypeDetails UserMailbox to the retrieval to exclude shared and resource mailboxes at the service, which is considerably faster than pulling everything and filtering afterward.
Requirements
ExchangeOnlineManagement module with an active Connect-ExchangeOnline session.
If the result is unexpected
The mailbox list excludes recipients visible elsewhere.
Recipient types, result limits, tenant context and Exchange connection state affect mailbox queries.
- Confirm the Exchange organization and inspect the recipient type of a known missing object.
Validate the result
The report includes the intended mailbox types and states exclusions explicitly.
Keep the check reliable
Record tenant, recipient filters and result-limit settings with exports.