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
Update-MgUser -UserId [email protected] -UsageLocation JPSet usage location first
Syntax
Set-MgUserLicense -UserId u -AddLicenses @{SkuId=g} -RemoveLicenses @(g)
Before you run it
Removal starts service data retention clocks.
Used when you see
Related commands
- Get-MgSubscribedSkuLicense inventory
- Get-MgUserInspect Entra users
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