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 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