Support
 
Phone Live Chat
 
Support
 
US: +1 888 720 9500
 
Intl: +1 925 924 9500
Aus: +1 800 631 268
UK: 0800 028 6590
CN: +86 400 660 8680

Direct Inward Dialing: +1 408 916 9393

 
 
 
 
 

How to change Microsoft 365 user licenses

This guide covers how to replace Microsoft 365 user licenses or adjust the services inside it the Microsoft 365 admin center, the Set-MgUserLicense PowerShell cmdlet, and ManageEngine ADManager Plus.

 
  • Microsoft 365 admin center
  • PowerShell
  • ADManager Plus
  • Why ADManager Plus
  • Real-world use cases
  • FAQ
  • Troubleshooting
 

How to change Microsoft 365 user licenses using the Microsoft 365 admin center

Prerequisites

  • Permissions: A role that can assign licenses, such as License Administrator or User Administrator. Global Administrator also works.
  • Tools: The Microsoft 365 admin center, opened in a web browser.
  • Setup: Confirm that the new license has unassigned units under Billing > Licenses.

Steps to change Microsoft 365 user licenses using the Microsoft 365 admin center

  1. Sign in to the Microsoft 365 admin center and go to Users > Active users.
  2. Select the user to open the details pane, then open the Licenses and apps tab.
  3. Clear the check box of the license to remove, and select the check box of the license to assign.
  4. Click Save changes.

To change the licenses of several users at once:

  1. Go to Users > Active users and select the check box next to each user.
  2. Click Manage product licenses. If the option is hidden on a smaller screen, open More actions (the ellipsis) first.
  3. Choose Replace to unassign the existing licenses and assign new ones, Assign more to keep the existing licenses and add others, or Unassign all to remove every license from the selected users.
  4. Select the license to assign and follow the prompts to confirm the change.

Limitations for changing Microsoft 365 user licenses via the Microsoft 365 admin center

  • The Replace option unassigns the existing licenses before it assigns the new ones, so it cannot swap one license while keeping the rest.
  • Users are picked from the Active users list by hand, which becomes slow when hundreds of accounts need a new license.

How to change Microsoft 365 user licenses using PowerShell

Prerequisites

  • Permissions: An account with the License Administrator or User Administrator role. When you connect, consent to the User.ReadWrite.All and Organization.Read.All scopes. LicenseAssignment.ReadWrite.All is the least privileged scope for assigning licenses.
  • Tools: The Microsoft Graph PowerShell SDK. PowerShell 7 or later is recommended. For Windows PowerShell, use version 5.1, .NET Framework 4.7.2 or later, and the latest PowerShellGet. The execution policy must be RemoteSigned or less restrictive.
  • Setup: Look up the SkuId of the license to remove and the license to add, and make sure each user has a usage location. The steps below cover both.
  • Module: The MSOnline module and its Set-MsolUserLicense cmdlet were retired in 2025, so scripts that call them no longer run. Use Set-MgUserLicense instead.

Steps to change Microsoft 365 user licenses using PowerShell

  1. Install the Microsoft Graph PowerShell SDK if it is not already installed.
    Install-Module Microsoft.Graph -Scope CurrentUser
  2. Connect to your tenant with the required scopes using Connect-MgGraph.
    Connect-MgGraph -Scopes "User.ReadWrite.All","Organization.Read.All"
  3. List the licenses in the tenant and note the SkuPartNumber and SkuId of the current and the new license. SkuId is a GUID, not the tenant:SKU form that the MSOnline module used. Compare EnabledUnits with ConsumedUnits to confirm that the new license has units available.
    Get-MgSubscribedSku -All | Select-Object SkuPartNumber, SkuId, ConsumedUnits, @{Name="EnabledUnits"; Expression={$_.PrepaidUnits.Enabled}}
  4. Check that the user has a usage location, which must be a two-letter ISO 3166-1 alpha-2 country code. Read it with Get-MgUser.
    Get-MgUser -UserId "kdennis@zylker.com" -Property UserPrincipalName, UsageLocation | Select-Object UserPrincipalName, UsageLocation
  5. If the value is blank, set it with Update-MgUser.
    Update-MgUser -UserId "kdennis@zylker.com" -UsageLocation "US"
  6. Replace the license with Set-MgUserLicense. The -AddLicenses parameter takes the license to assign, and -RemoveLicenses takes the SkuId of the license to remove.
    $oldSku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E3"
    $newSku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E5"
    Set-MgUserLicense -UserId "kdennis@zylker.com" -AddLicenses @{SkuId = $newSku.SkuId} -RemoveLicenses @($oldSku.SkuId)
  7. Verify the change with Get-MgUserLicenseDetail.
    Get-MgUserLicenseDetail -UserId "kdennis@zylker.com" | Select-Object SkuPartNumber, SkuId

Change a license and turn off selected service plans

Pass DisabledPlans with the service plan IDs to switch off while the new license is assigned.

$oldSku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E3"
$newSku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E5"
$disabledPlans = $newSku.ServicePlans | Where-Object ServicePlanName -in ("LOCKBOX_ENTERPRISE", "MICROSOFTBOOKINGS") | Select-Object -ExpandProperty ServicePlanId
$addLicenses = @(@{SkuId = $newSku.SkuId; DisabledPlans = $disabledPlans})
Set-MgUserLicense -UserId "kdennis@zylker.com" -AddLicenses $addLicenses -RemoveLicenses @($oldSku.SkuId)

Keep a user's existing disabled service plans

Read the plans already switched off on the user's license, add the new ones, and pass the combined list so that nothing is switched back on.

$e5Sku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E5"
$userLicense = Get-MgUserLicenseDetail -UserId "kdennis@zylker.com" | Where-Object SkuId -eq $e5Sku.SkuId
$userDisabledPlans = $userLicense.ServicePlans | Where-Object ProvisioningStatus -eq "Disabled" | Select-Object -ExpandProperty ServicePlanId
$newDisabledPlans = $e5Sku.ServicePlans | Where-Object ServicePlanName -in ("SWAY", "FORMS_PLAN_E5") | Select-Object -ExpandProperty ServicePlanId
$disabledPlans = ($userDisabledPlans + $newDisabledPlans) | Select-Object -Unique
$addLicenses = @(@{SkuId = $e5Sku.SkuId; DisabledPlans = $disabledPlans})
Set-MgUserLicense -UserId "kdennis@zylker.com" -AddLicenses $addLicenses -RemoveLicenses @()

Copy the license assignment from another user

Pass the AssignedLicenses of a reference user to give another user the same licenses.

$source = Get-MgUser -UserId "belindan@zylker.com" -Property AssignedLicenses
Set-MgUserLicense -UserId "kdennis@zylker.com" -AddLicenses $source.AssignedLicenses -RemoveLicenses @()

Supported parameters: Connect-MgGraph

Parameter Description
-Scopes The Microsoft Graph permission scopes to request for the session, such as User.ReadWrite.All.
-TenantId The tenant to sign in to, as a tenant ID or domain name.
-NoWelcome Hides the welcome banner after the connection is made.

Supported parameters: Get-MgSubscribedSku

Parameter Description
-All Returns every license plan in the tenant instead of only the first page.
-Property Limits the properties returned, such as SkuPartNumber, SkuId, or ServicePlans.

Supported parameters: Get-MgUser

Parameter Description
-UserId The object ID or user principal name of the user.
-Filter An OData filter, such as assignedLicenses/any(s:s/skuId eq <SkuId>), to find users who hold a license.
-Property The properties to return, such as UserPrincipalName, UsageLocation, or AssignedLicenses.
-All Returns all matching users instead of only the first page.

Supported parameters: Update-MgUser

Parameter Description
-UserId The object ID or user principal name of the user to update.
-UsageLocation The two-letter ISO 3166-1 alpha-2 country code to set, such as US or FR.

Supported parameters: Set-MgUserLicense

Parameter Description
-UserId The object ID or user principal name of the user whose licenses change.
-AddLicenses The licenses to assign, as hash tables with a SkuId and an optional DisabledPlans list.
-RemoveLicenses The SkuIds of the licenses to remove. Pass @() when nothing should be removed.
-WhatIf Shows what would change without making the change.
-Confirm Prompts for confirmation before the change is made.

Supported parameters: Get-MgUserLicenseDetail

Parameter Description
-UserId The object ID or user principal name of the user whose licenses are listed.
-Property Limits the properties returned, such as SkuPartNumber or ServicePlans.

Limitations for changing Microsoft 365 user licenses via PowerShell

  • Set-MgUserLicense changes one user per call, so changing many users needs a loop with its own error handling.
  • Licenses are identified by SkuId GUIDs, which the script has to look up with Get-MgSubscribedSku before it changes anything.
  • Unattended runs need a separate authentication setup instead of an interactive sign-in.

How to change Microsoft 365 user licenses using ADManager Plus

Prerequisites

  • Permissions: Sign in as an administrator, or as a technician who is delegated to manage Microsoft 365 licenses.
  • Tools: ADManager Plus with the Microsoft 365 tenant configured using valid credentials, on a server that can reach Microsoft Graph.
  • Setup: Decide the usage location to apply. ADManager Plus calls it User Location, and it is required when you assign or replace licenses.

Steps to change Microsoft 365 user licenses using ADManager Plus

  1. Log in to ADManager Plus and click the Microsoft 365 tab.
  2. Go to Management > License Management > Assign/Remove Licenses.
  3. Select the Microsoft 365 tenant.
  4. In the Assign/Remove Licenses field, choose Replace all licenses. Choose Assign selected licenses or Remove selected licenses instead when you only need to add or take away a specific license.
  5. Select the new license and the User Location.
  6. Select the users by searching for them, or click Import CSV to load a file with a UserPrincipalName or ObjectId column. If the tenant is linked to your on-premises Active Directory, you can also filter the users by domain and OU.
Changing Microsoft 365 user licenses using ADManager Plus.
Changing Microsoft 365 user licenses using ADManager Plus.
Note:

Replace all licenses removes the previous licenses of the selected users. When users hold other licenses that must stay, assign the new license first and then run Remove selected licenses for the old one.

How ADManager Plus streamlines changing Microsoft 365 user licenses

  • Bulk license changes: Add, replace, or remove licenses for many users in one pass, using search or a CSV file.
  • Group-based modification: Change the licenses of every user in a group from a single page.
  • License reports: Review licensed users, unlicensed users, and license details before and after a change.
  • Automation: Run license assignment or removal hourly, daily, weekly, monthly, or once, using users from a report or a CSV file.
  • Delegation: Let help desk technicians handle license changes without giving them full admin access.

Real-world use cases

Use case 1: Replace a license with another for every user who holds it

This script finds every user who holds the old license, swaps it for the new one, and reports any user it could not change.

Connect-MgGraph -Scopes "User.ReadWrite.All","Organization.Read.All"
$oldSku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E3"
$newSku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E5"
$users = Get-MgUser -Filter "assignedLicenses/any(s:s/skuId eq $($oldSku.SkuId))" -All -Property Id, UserPrincipalName
if (-not $users) {
    Write-Host "No users hold the license to replace."
    return
}
foreach ($user in $users) {
    try {
        Set-MgUserLicense -UserId $user.Id -AddLicenses @{SkuId = $newSku.SkuId} -RemoveLicenses @($oldSku.SkuId) -ErrorAction Stop | Out-Null
        Write-Host "Changed license for $($user.UserPrincipalName)"
    } catch {
        Write-Warning "Could not change license for $($user.UserPrincipalName): $($_.Exception.Message)"
    }
}

With ADManager Plus:

  1. Click the Microsoft 365 tab, select Reports in the left pane, and click Licensed Users.
  2. Select the tenant and click Generate.
  3. Export the report as CSV and keep only the users who hold the license you are replacing. Make sure the file has a UserPrincipalName or ObjectId column.
  4. Go to Management > License Management > Assign/Remove Licenses, select the tenant, click Import CSV to load the file, and select the imported users.
  5. In the Assign/Remove Licenses field, choose Replace all licenses.
    Replacing Microsoft 365 licenses for users imported from a report using ADManager Plus.
    Replace all licenses selected on the Assign/Remove Licenses page for users imported from the Licensed Users report.
  6. Select the new license and the User Location, then click Apply. '
Note:

If the users hold other licenses that must stay, choose Assign selected licenses in step 5 instead, and click Apply to add the new license. Then repeat step 5 with Remove selected licenses, select the old license, and click Apply.

Use case 2: Remove a redundant license from users who already hold the upgraded license

This script finds users who hold both the old standalone license and the upgraded license, then removes the standalone one.

Connect-MgGraph -Scopes "User.ReadWrite.All","Organization.Read.All"
$redundantSku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "EXCHANGEENTERPRISE"
$keepSku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq "SPE_E3"
$users = Get-MgUser -Filter "assignedLicenses/any(s:s/skuId eq $($redundantSku.SkuId))" -All -Property Id, UserPrincipalName, AssignedLicenses | Where-Object { $_.AssignedLicenses.SkuId -contains $keepSku.SkuId }
if (-not $users) {
    Write-Host "No users hold both licenses."
    return
}
foreach ($user in $users) {
    try {
        Set-MgUserLicense -UserId $user.Id -AddLicenses @() -RemoveLicenses @($redundantSku.SkuId) -ErrorAction Stop | Out-Null
        Write-Host "Removed the redundant license from $($user.UserPrincipalName)"
    } catch {
        Write-Warning "Could not remove the license from $($user.UserPrincipalName): $($_.Exception.Message)"
    }
}

With ADManager Plus:

  1. Click the Microsoft 365 tab, select Reports in the left pane, and click Licensed Users.
  2. Select the tenant and click Generate.
  3. Export the report as CSV and keep only the users who hold both licenses. Make sure the file has a UserPrincipalName or ObjectId column.
  4. Go to Management > License Management > Assign/Remove Licenses, select the tenant, and click Import CSV to load the file.
  5. In the Assign/Remove Licenses field, choose Remove selected licenses and select the redundant license. Selecting a User Location is optional when you only remove licenses.
  6. Select the users and click Apply.
Removing a redundant Microsoft 365 license from imported users using ADManager Plus.
Remove selected licenses chosen on the Assign/Remove Licenses page, with the redundant license selected for the imported users.

FAQs

Run Get-MgSubscribedSku -All | Select-Object SkuPartNumber, SkuId. SkuPartNumber is the readable ID, such as SPE_E5, and SkuId is the GUID that Set-MgUserLicense expects. Microsoft also publishes a list that maps product names to SKU part numbers and service plan IDs. In ADManager Plus, the License Details report lists every license in the tenant along with the services each one includes.

No. Microsoft retired the MSOnline module in 2025, so scripts that use it need to move to the Microsoft Graph PowerShell SDK. Connect-MsolService becomes Connect-MgGraph, Get-MsolUser becomes Get-MgUser, and Set-MsolUserLicense becomes Set-MgUserLicense. Licenses are now identified by the SkuId GUID instead of the AccountSkuId in the tenant:SKU form, and the DisabledPlans value in the -AddLicenses hash table replaces New-MsolLicenseOptions.

Some Microsoft 365 services are not available in every country or region, so a license can only be assigned to a user whose UsageLocation is a valid ISO 3166-1 alpha-2 country code. Set it with Update-MgUser -UsageLocation, or choose the User Location in ADManager Plus when you assign or replace licenses.

In the standard scenario, a mailbox without a hold is disconnected when its Exchange Online license is removed. Reassigning a license within 30 days reconnects it, and after 30 days the data is permanently deleted. Retention policies and holds can affect data preservation.

Yes. In PowerShell, loop through the users and call Set-MgUserLicense for each one, as shown in the use cases above. In ADManager Plus, select users by search or CSV import, or use the Group Based License Modification feature, and schedule recurring license tasks when the change should repeat.

Troubleshooting

The user has no usage location, or the value is not valid. Set it with Update-MgUser -UserId "kdennis@zylker.com" -UsageLocation "US", then run Set-MgUserLicense again.

The signed-in account does not hold a role that can assign licenses, or the session was not granted the scopes. Confirm that the account is a License Administrator or User Administrator, then reconnect with Connect-MgGraph -Scopes "User.ReadWrite.All","Organization.Read.All" and accept the consent prompt.

This error was reported with Microsoft Graph PowerShell SDK 2.26.1, which left empty -AddLicenses or -RemoveLicenses arrays out of the request. Check the installed version with Get-InstalledModule Microsoft.Graph, update it with Update-Module Microsoft.Graph, and run the command again. If the error remains, send the request with Invoke-MgGraphRequest, which the SDK maintainers suggested as a workaround.

The new license has no unassigned units left. Compare ConsumedUnits with EnabledUnits in step 3 of the PowerShell steps, then add units or free some by removing the license from users who no longer need it.

Two licenses on the user include service plans that cannot be assigned together, and Microsoft Entra ID does not resolve the conflict on its own. Turn off the overlapping plan on one of the licenses with DisabledPlans, or remove the conflicting license.

The MSOnline module was retired in 2025, so any script that calls it stops at the first Msol cmdlet. Rewrite the script with the Microsoft Graph equivalents listed in the second FAQ.

ADManager Plus Trusted By

The one-stop solution to Active Directory Management and Reporting