Office365: Assigning licenses using Azure AD PowerShell

Every O365 administrator will have done this…assigning licenses to users. Before Microsoft came with ‘Group based licensing’, user licensing was either being done manually with someone logging into the portal or using PowerShell script.
In this article, I’ll discuss the PowerShell commands to manage user licensing using Azure AD PowerShell module. These commands can be fit into various scenarios e.g. Reset licenses in bulk.
Let’s get into it.

Licensing commands

Below is a list of licensing related PowerShell commands, we’ll use to configure user licenses.
  • Get-AzureADUser: Gets an AAD user. AssignedLicenses is the property that tells us 1. Which licenses are assigned to User and 2. Which service plans are disabled?
  • Get-AzureADSubscribedSku: Get a list of all licenses available to the tenant
  • Microsoft.Open.AzureAD.Model.AssignedLicense: Create a new object of this Class to configure license assignment options.
  • Microsoft.Open.AzureAD.Model.AssignedLicenses: A collection of licenses to add or remove to the User


Assign an E3 license to all Users enclosed in CSV file and enable only SharePoint Online, Office Online and Skype for Business. All other plans will be disabled. Also remove Power BI license for any user who has it currently assigned.


PowerShell script is pretty self-explanatory. Once again, you can change the script to meet all kinds of different scenarios.

Get the code from GitHub


Popular posts from this blog

SharePoint 2013 Search Service Activation Error

VMWare Workstation - Assign a static IP address

SharePoint 2013 Intranet, Extranet & Internet architecture