Remove Office 365 Licenses using PowerShell

02 Feb Remove Office 365 Licenses using PowerShell

There are times when you might face issue with changing license assignments for an office 365 user using the Admin Portal. You can use use instructions in this post and use PowerShell to fix this.

1. Open Azure Active Directory Module for Windows PowerShell and connect to Office 365 using below commands. Enter the credentials of global admin when prompted.

$UserCredential = Get-Credential

Connect-MsolService -Credential $UserCredential

image

2. Run the following command to get a list of licenses assigned to the user.

Get-MsolUser –UserPrincipalName “username@domain.com”| FL display*,licenses

image

3. Run the following command to remove the license you want to remove. You can then run the command in step 2 to verify if license is removed or you can also verify using admin portal.

Set-MsolUserLicense -UserPrincipalName user@domain.com -RemoveLicenses “Orgname:license”

image

Vineet Arora
vineet.arora@mismosystems.com
No Comments

Post A Comment