A practical foundation in PowerShell for M365 tenant-to-tenant migrations, covering module selection, authentication, and reusable automation patterns.
A tenant-to-tenant migration is hundreds of small, repeated operations: read a user from the source, decide where it lands, create or match it in the target, assign a license, map a mailbox. Done by hand in two admin portals, that is days of clicking and a guaranteed transcription error. Done in PowerShell, it is a script you run, audit, and re-run. This guide lays the foundation: the right modules, clean authentication to two tenants at once, and the helper patterns every later script depends on.
Microsoft has consolidated most tenant-management surface into two supported module families. Avoid the deprecated MSOnline and AzureAD modules — they are on a retirement path and their Graph-backed replacements expose more data.
| Module | Installs as | Use it for |
|---|---|---|
| Microsoft Graph SDK | Microsoft.Graph | Users, groups, licenses, devices, directory objects, sign-in data |
| Exchange Online Management | ExchangeOnlineManagement | Mailboxes, recipients, transport rules, mailbox permissions |
| SharePoint Online (PnP) | PnP.PowerShell | Sites, lists, sharing, OneDrive provisioning |
| Microsoft Teams | MicrosoftTeams | Teams, channels, policies |
Install the meta-module only if you need everything; it is large. For migrations you usually want a few sub-modules to keep import time and memory down:
Is it really free?
Yes — completely. No trial, no card, no catch. Enter your email and the full guide opens instantly.
Will you spam me?
No. We'll email your copy and, only if you opt in, the occasional genuinely useful migration tip. One click unsubscribes you for good.
Can I share it with my team?
Please do. Forward the PDF or send them the link — every teammate can grab their own copy.