PowerShell Genie

ExchangeOnlineManagement module: setup and commands

Module 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Connect with Connect-ExchangeOnline and query mailboxes with Get-EXOMailbox while requesting only the properties your report actually needs.

Getting it

Install-PSResource -Name ExchangeOnlineManagement from the PowerShell Gallery, then run Connect-ExchangeOnline before anything else.

Examples

1PS> Get-EXOMailbox -ResultSize 100
Show reference output
1 DisplayName PrimarySmtpAddress RecipientTypeDetails
2 -------------- ------------------- --------------------
3 Adele Vance adelev@contoso.com UserMailbox
4 Shared Support support@contoso.com SharedMailbox
1PS> Get-MailboxStatistics -Identity user@contoso.com
Show reference output
1 DisplayName ItemCount TotalItemSize
2 ----------- --------- -------------
3 Sample User 1242 1.25 GB (1,342,177,280 bytes)

What it is for

Use it for mailbox inventory, mail flow rule review, permission audits, and recipient changes across a tenant. Prefer the Get-EXO cmdlets for reporting, since they return faster and accept property sets.

Typical tasks

  • Inventory mailboxes by recipient type
  • Report mailbox sizes and item counts
  • Find mailboxes configured to forward mail
  • Audit delegated mailbox permissions
  • Export transport rules for change control
  • Review inbound and outbound connectors

Check the installed version

1PS> Get-Module -ListAvailable ExchangeOnlineManagement | Select-Object Name, Version, Path
2PS> Get-Command -Module ExchangeOnlineManagement

Compare the module path and version with the session used by your scheduled task or automation account. Use it for mailbox inventory, mail flow rule review, permission audits, and recipient changes across a tenant. Prefer the Get-EXO cmdlets for reporting, since they return faster and accept property sets.

Primary documentation

Microsoft 365, Entra and Azure documentation

Continue
Genie guideExchangeOnlineManagement module: setup and commands

Connect with Connect-ExchangeOnline and query mailboxes with Get-EXOMailbox while requesting only the properties your report actually needs.