Objectives
| # | Objective |
| 1 | Install the ExchangeOnlineManagement module from the PowerShell Gallery |
| 2 | Connect to Exchange Online using Connect-ExchangeOnline with modern authentication |
| 3 | Verify the session is active and understand what connection context means |
| 4 | Run Get-EXOMailbox to query mailboxes and understand why it outperforms Get-Mailbox |
| 5 | Use -ResultSize, -Filter and -Properties to build efficient queries |
| 6 | Disconnect cleanly using Disconnect-ExchangeOnline |
| 7 | Knowledge check โ EXO connection fundamentals |
Key Concepts
| Concept | What it means |
| EXO V3 Module | The current ExchangeOnlineManagement module (v3+). Uses REST-based cmdlets (Get-EXOMailbox) that are faster and more scalable than the legacy remote PowerShell cmdlets (Get-Mailbox). |
| Modern Auth | OAuth 2.0-based authentication. Required for all new EXO connections. Supports MFA, conditional access, and app-only (certificate-based) authentication for unattended scripts. |
| Connection Context | When you connect, the module creates a session bound to your credentials and permissions. All subsequent cmdlets run in that context until you disconnect. |
| Get-EXOMailbox | The REST-based replacement for Get-Mailbox. Dramatically faster on large tenants because it uses server-side filtering and returns only requested properties โ not entire objects. |
| -ResultSize | Caps the number of objects returned. Default is 1,000 in legacy cmdlets. Use -ResultSize Unlimited carefully โ on large tenants this can pull tens of thousands of objects. |
| -Filter | Server-side filtering โ evaluated in Exchange Online before data is returned. Far more efficient than piping through Where-Object, which filters client-side after retrieving all objects. |
Commands Used in This Lab
| Cmdlet | Purpose |
| Install-Module ExchangeOnlineManagement | Install the EXO module from PSGallery |
| Import-Module ExchangeOnlineManagement | Load the module into the session |
| Get-Module ExchangeOnlineManagement | Verify the module is loaded and check its version |
| Connect-ExchangeOnline | Authenticate and open an EXO session |
| Connect-ExchangeOnline -UserPrincipalName | Connect as a specific admin UPN |
| Get-ConnectionInformation | Show active connection details and session state |
| Get-EXOMailbox | List mailboxes using the fast REST-based cmdlet |
| Get-EXOMailbox -ResultSize 10 | Return first 10 mailboxes only |
| Get-EXOMailbox -Filter | Server-side filter โ e.g. by RecipientTypeDetails |
| Get-EXOMailbox -Properties | Request only specific properties to improve performance |
| Disconnect-ExchangeOnline | Close the EXO session cleanly |
This is a simulated EXO environment. Commands behave as they would against a live tenant with ~40 mailboxes. Tab completes cmdlet names. โ โ for history. Type ? at any time for available commands.