JAEN

Microsoft 365

Set-MgUserLicense

CautionAssign/remove licenses

Set-MgUserLicense -UserId <user> -AddLicenses @{SkuId=<id>} -RemoveLicenses @()

Assigns or strips licenses; the user needs UsageLocation set first. Get SkuIds from Get-MgSubscribedSku.

Examples

Syntax

Set-MgUserLicense -UserId u -AddLicenses @{SkuId=g} -RemoveLicenses @(g)

Before you run it

Removal starts service data retention clocks.

Used when you see

License assignment fails
3
Assign the license and confirm
See the whole flow →

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store