Automate bulk license assignment for tenant migrations using Microsoft Graph, covering usageLocation, disabled plans, group-based licensing, and reconciliation.
Every user that lands in the target tenant needs the right license before they can send mail or open a file — and assigning hundreds of them by hand in the portal is both slow and error-prone. Worse, the most common failure (usageLocation not set) produces a cryptic error that stalls a cutover. This guide automates bulk licensing end to end: setting prerequisites, assigning SKUs with selective service plans, swapping licenses, and reconciling what actually got applied.
Licenses are SKUs (subscribedSku), each containing service plans (Exchange, SharePoint, Teams, etc.). You assign a SKU to a user with assignLicense, optionally disabling specific plans. Two prerequisites trip people up:
| Prerequisite | Why it matters |
|---|---|
usageLocation set on the user | License assignment fails without it |
| Available units on the SKU | You cannot assign more than prepaidUnits.enabled |
Connect-MgGraph -TenantId $env:TARGET_TENANT_ID -Scopes @(
'User.ReadWrite.All','Organization.Read.All','Directory.ReadWrite.All'
) -NoWelcome
# Discover SKUs and remaining capacity before assigning anything
Get-MgSubscribedSku | Select-Object SkuPartNumber, SkuId,
@{n='Enabled';e={$_.PrepaidUnits.Enabled}},
ConsumedUnits,
@{n='Available';e={$_.PrepaidUnits.Enabled - $_.ConsumedUnits}}
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.