(Cloud) Tip of the Day: Add licenses using PowerShell
Today’s (Cloud) Tip…
If you have Office 365, Intune, or Azure Active Directory subscriptions, you can assign licenses to your users using Azure Active Directory Module for Windows PowerShell.
Open Azure Active Directory Module for Windows PowerShell and connect to Azure Active Directory.
Connect to Azure AD Using Windows PowerShell
First thing you need to do is get the list of available Subscription ID's by running the following cmdlet.
Get-MsolAccountSku
Your results will look something like this…
Pick one that you want to assign to the user and run the following similar script.
Set-MsolUserLicense –UserPrincipalName user@domain.com –AddLicenses AccountSkuId
Here is an example of how it should look like…
Set-MsolUserLicense –UserPrincipalName john@contoso.com –AddLicenses contoso:ENTERPRISEPACK
Reference: