Provision E3 license through PowerShell (and take away apps)

These directions will show how to provision an Office 365 E3 license through PowerShell, and take away some apps.

Connect to O365 in Powershell

- Open PowerShell ISE
- Run this script

Install-Module -Name AzureAD


- Sign into Office 365 when prompted as a global admin

Set the usage location

- Run this script
Set-MsolUser -UserPrincipalName "" -UsageLocation US 

You can find all users that do not have a user location assigned by running this command:

Get-MsolUser -All | where {$_.UsageLocation -eq $null

Turn on the E3 license

Set-MsolUserLicense -UserPrincipalName "" -AddLicenses "contoso:ENTERPRISEPACK"

To see what licenses you have available, run this:

Remove Unnecessary Apps


Set-MsolUserLicense -UserPrincipalName "" -LicenseOptions $LO

To change licenses, re-run this with different options

When plugging this into Excel, an example formula to use is:
=CONCAT("Set-MsolUserLicense -UserPrincipalName """, D2, """ -LicenseOptions $LO")

You can get a list of apps to turn off or on for $LO using this powershell:
Get-MsolAccountSku | Where-Object AccountSkuId -like '*enterprisepack*' | Select-Object -ExpandProperty ServiceStatus 


Share on Google Plus

About Tom DeMeulenaere

Highly accomplished information technology professional with extensive knowledge in System Center Configuration Manager, Windows Server, SharePoint, and Office 365.
    Blogger Comment