Skip to content

How to Assign Microsoft 365 Licenses to Users

Assign Microsoft 365 licenses the right way: admin center direct vs group-based licensing, usage location, PowerShell and Graph, license conflicts, and clean removal.

MGMCSA Guru Team August 16, 2026 7 min read
Diagram-style cover showing a Microsoft 365 license being assigned to a user directly and through a group, with usage location set

Assigning a Microsoft 365 license sounds like a two-click job, and for a single new hire it basically is. The complications show up at scale: a department of forty people, a license that fails to apply for no obvious reason, or a user who somehow has the same product assigned twice and you can’t remove it. Knowing the few rules behind licensing turns those head-scratchers into quick fixes.

This guide covers the three ways you’ll actually assign licenses — the admin center, group-based licensing, and PowerShell/Graph — plus the usage location requirement that trips people up, how to read a license conflict, and how to remove a license without losing the user’s data by accident.

Assigning a license in the admin center

For one or a handful of users, the Microsoft 365 admin center is the fastest route.

  1. Go to the Microsoft 365 admin centerUsers → Active users.
  2. Select the user (or tick several to assign in bulk).
  3. Open the Licenses and apps tab.
  4. Pick the location if prompted, tick the license(s) to assign, and optionally expand Apps to turn individual service plans on or off.
  5. Save.

When you assign interactively like this, the admin center sets the usage location for you based on the tenant or your selection, which is why direct assignment “just works” while scripts sometimes don’t.

Group-based licensing: the scalable way

Assigning licenses one user at a time doesn’t hold up past a small team. Group-based licensing (managed in Entra ID) solves it: you assign the license to a security group, and every member inherits it automatically. Add someone to the group and they get the license; remove them and it’s revoked. New hires get fully licensed the moment they land in the right group.

To set it up:

  1. In the Entra admin center, go to Billing → Licenses (or Groups then the licensing blade).
  2. Select the license, choose Assign, and pick the security group.
  3. Configure which service plans are enabled for that group.
  4. Save. Entra processes the membership and applies the license to each member.

Group-based licensing also surfaces errors cleanly. If a member can’t be licensed — no seats left, a service plan conflict, missing usage location — Entra flags that group/user combination with the reason, so you can find and fix problem accounts instead of discovering them one support ticket at a time.

Don’t forget usage location

This is the setting that quietly breaks scripted assignments. Microsoft 365 restricts some services by country, so Entra requires a usage location on the account before it will assign certain licenses. Assign through the admin center UI and it’s handled for you. Assign through PowerShell or Graph and you often have to set it first, or the call fails.

# Microsoft Graph PowerShell SDK
Connect-MgGraph -Scopes "User.ReadWrite.All", "Organization.Read.All"

# Set usage location (ISO 3166-1 alpha-2 country code, e.g. US, GB, DE)
Update-MgUser -UserId "[email protected]" -UsageLocation "GB"

Assigning licenses with PowerShell and Graph

For bulk work, automation, or onboarding scripts, PowerShell is the tool. The older MSOnline (MsolUser) and AzureAD modules are deprecated — use the Microsoft Graph PowerShell SDK going forward.

The Graph approach uses SKU part numbers. First find the SKU you want to assign:

Connect-MgGraph -Scopes "Organization.Read.All"

# List the SKUs in your tenant with their IDs and available seats
Get-MgSubscribedSku | Select-Object SkuPartNumber, SkuId, `
  @{N='Consumed';E={$_.ConsumedUnits}}, `
  @{N='Enabled';E={$_.PrepaidUnits.Enabled}}

Then assign it. Set-MgUserLicense takes the SKU ID in its AddLicenses parameter:

Connect-MgGraph -Scopes "User.ReadWrite.All", "Organization.Read.All"

$user = "[email protected]"
$sku  = (Get-MgSubscribedSku | Where-Object SkuPartNumber -eq "SPE_E3").SkuId

# Usage location must be set first (see earlier) or this can fail
Set-MgUserLicense -UserId $user `
  -AddLicenses @{ SkuId = $sku } `
  -RemoveLicenses @()

To assign to many users, loop over a list or a CSV:

$sku = (Get-MgSubscribedSku | Where-Object SkuPartNumber -eq "SPE_E3").SkuId

Import-Csv .\users.csv | ForEach-Object {
    Update-MgUser -UserId $_.UPN -UsageLocation $_.Location
    Set-MgUserLicense -UserId $_.UPN -AddLicenses @{ SkuId = $sku } -RemoveLicenses @()
    Write-Host "Licensed $($_.UPN)"
}

License and service-plan conflicts

Two kinds of conflict come up:

  • License (SKU) conflict — a user is assigned the same product both directly and through a group. You can’t remove the group’s copy from that individual user; you remove them from the group or remove the direct assignment, depending on which you meant to keep.
  • Service plan conflict — two different products include an overlapping service plan that can’t be enabled twice for the same user. Assigning the second product fails until you disable the conflicting plan on one of them.

Common license assignment problems and fixes

Missing usage location Set usage location on the account, then re-assign
No available seats Free up a seat or buy more; check Get-MgSubscribedSku consumed vs enabled
Same license direct + via group Remove the direct assignment or the group membership, not both
Service plan conflict Disable the overlapping plan on one of the conflicting products

The cleanest way to avoid the direct-plus-group tangle is to pick one model per license and stick to it. Use group-based licensing for standard role-based bundles, and reserve direct assignment for genuine one-offs. Mixing both for the same product on the same users is what creates the “can’t remove it” headaches.

Removing a license cleanly

Removing a license isn’t just unticking a box — it starts retention clocks on the user’s data.

  • In the admin center, open the user’s Licenses and apps tab, untick the license, and save. If it’s a group-based license, remove the user from the group instead.
  • With Graph: Set-MgUserLicense -UserId $user -RemoveLicenses @($sku) -AddLicenses @{}.

Before you remove a license from a departing user

  • Decide if the mailbox should become a shared mailbox to retain access
  • Note the 30-day Exchange Online mailbox grace period after license removal
  • Check OneDrive retention and reassign ownership if needed
  • Export or transfer any data the team still needs
  • Confirm whether the license is direct or group-based before removing

Wrapping up

Pick the assignment method that matches the scale: the admin center for a few users, group-based licensing for teams and departments, and the Microsoft Graph PowerShell SDK for bulk or automated work. Set usage location before scripted assignments so they don’t fail silently, keep each product on a single licensing model to avoid direct-plus-group conflicts, and treat removal as a data event, not just a checkbox.

Once accounts are licensed, the next steps are usually getting the rest of the tenant in order. If you’re standing up a new tenant, see how to add a custom domain to Microsoft 365, and lock down those freshly licensed accounts by enabling MFA for your users.

Frequently asked questions

What is the difference between direct and group-based licensing?

Direct licensing assigns a license straight to an individual user account. Group-based licensing assigns the license to a security group, and every member inherits it automatically. Group-based scales better for teams and departments because adding or removing someone from the group handles the license for you.

Why do I need to set a usage location before assigning a license?

Some Microsoft 365 services are restricted by country, so Entra ID requires a usage location on the account before it lets you assign certain licenses. If usage location is missing, the assignment can fail. The admin center sets it for you when you assign a license interactively, but PowerShell and Graph often need it set explicitly first.

Can a user have both a direct and a group-based license at the same time?

Yes, and that's a common cause of confusion. If a user gets the same license directly and through a group, you can't remove the group's license from that user individually. You either remove them from the group or strip the direct assignment, depending on which one you intended to keep.

What causes a license assignment to fail?

The usual causes are a missing usage location, no available licenses left in the tenant, or a service plan conflict where two products include an overlapping plan that can't coexist. The admin center and the Entra licensing logs will name the specific reason so you can fix it.

What happens to a user's data when I remove their license?

Removing a license stops the services and starts a retention clock. For Exchange Online, the mailbox enters a 30-day grace period before deletion, and OneDrive content has its own retention window. If the user is leaving, convert the mailbox to shared or export the data before the grace period ends.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.