The ExchangeOnlineManagement module is the official PowerShell module for managing Exchange Online in Microsoft 365. It supports modern authentication, including MFA, and provides REST-based cmdlets for better performance.
· Windows PowerShell 5.1 or PowerShell 7+ (cross-platform).
· PowerShellGet and PackageManagement modules installed.
- Install-Module PowerShellGet -Force
- Install-Module PackageManagement -Force
· Exchange Online admin permissions.
Run PowerShell as Administrator and execute:
Install-Module -Name ExchangeOnlineManagement
Get-Module ExchangeOnlineManagement -ListAvailable
Import-Module ExchangeOnlineManagement
Interactive Login (with MFA):
Connect-ExchangeOnline -UserPrincipalName yourUPN@domain.com
Device Login (PowerShell 7):
Connect-ExchangeOnline -Device
List all mailboxes:
Get-Mailbox
Check mailbox size:
Get-MailboxStatistics -Identity user@domain.com
Create a new mailbox:
New-Mailbox -Name "User Name" -MicrosoftOnlineServicesID user@domain.com -Password (ConvertTo-SecureString -String 'Password123' -AsPlainText -Force)
Disconnect-ExchangeOnline -Confirm:$false
Microsoft Learn: Connect to Exchange Online PowerShell