Skip to content
theDXT
  • Home
  • IT
  • Scripts
  • GitHub
  • LinkedIn
  • X (Twitter)
  • Search Icon
Swap Office 365 Licences

Swap Office 365 Licences

January 27, 2018

Update

The process detailed below has been deprecated by Microsoft. An updated version of this process is detailed in my post called Swap Microsoft 365 Licenses with Microsoft Graph.

I needed to remove some expired Office 365 licences that were expired to the point where I couldn’t do it via the admin interface so I wrote a PowerShell script to automate swapping the Office 365 licences.

You will want to run Get-MsolAccountSku this will list out the various SKUs your account has. something like this

tenant:VISIOCLIENT
tenant:PROJECTCLIENT
tenant:EXCHANGESTANDARD
tenant:O365_BUSINESS_PREMIUM
tenant:OFFICESUBSCRIPTION
tenant:PROJECTPROFESSIONAL

Just change the values in the script below to match what product you want to remove and replace it with and then run it.

$remove = "tenant:EXCHANGESTANDARD"
$add = "tenant:O365_BUSINESS_PREMIUM"

$swap = get-MSOLUser -All | where {$_.isLicensed -eq "TRUE" -and $_.Licenses.AccountSKUID -eq "$remove"}

Foreach ($User in $swap) {
Set-MsolUserLicense -UserPrincipalName $User.UserPrincipalName -RemoveLicenses "$remove" -AddLicenses $add
}
Code language: PowerShell (powershell)

That is basically it. It will just run and swap the licences.

Related posts:

Swap Microsoft 365 Licenses with Microsoft Graph Default ThumbnailMass Edit ADSI Values Omnissa Horizon Term License Expiry Microsoft 365 Enable Organization Customization

IT, Scripts
Office 365, PowerShell

Post navigation

PREVIOUS
Find files and folders
NEXT
Mass Edit ADSI Values

One thought on “Swap Office 365 Licences”

  1. Pingback: Swap Microsoft 365 Licenses with Microsoft Graph - theDXT

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About Me

Daniel Keer

Project Lead, Senior Consultant at Digitally Accurate Inc.

Awards and Certificates
VMware vExpert ⭐⭐⭐
Omnissa Tech Insider ⭐⭐⭐

Consulting

Stuck on something? Reach out to Digitally Accurate Inc. and we can provide expert IT consulting to help you move forward.

  • Veeam Backup & Replication 13 Windows Install
  • Enable Windows 10 Extended Security Updates
  • slmgr.vbs
  • CyberChef
  • Install or Upgrade Duo Authentication for Windows Logon
© 2026   Copyright. All Rights Reserved.