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 on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store