O365 License Assignments and Granular Service Enablement
Overview
Hi Everyone. I wanted to share some information on O365 licensing. I recently was working on a project where bulk licensing changes were needed, and the requirements included setting licenses in a granular fashion, to included/exclude certain services, instead of just setting the full License. As a result, I compiled some of the links, syntax, and approach I used which was the most effective method for me to understand and accomplish this task.
Understanding
First we need to understand licensing a bit. Anyone working in the O365 space understands licensing to a certain extent. As the planning discussions progress, organizations must determine which Licenses to purchase for their end users. Each license level (AccountSkuID) comes with a set of functionality, and license levels can be mixed among the user population based on the organizational requirements. The 2 links link below describes the various licensing levels, and provides an overview of the associated functionality with those licenses.
Plans for Business:
https://office.microsoft.com/en-us/business/compare-office-365-for-business-plans-FX102918419.aspx
Kiosk Plans:
https://office.microsoft.com/en-us/business/compare-office-365-kiosk-plans-FX103178917.aspx
That’s all great, but in my case we wanted to assign these licenses and enabled each service for the end user, as needed. We wanted Lync enabled for some users, Exchange for others, Sharepoint for others, and several combinations thereof.
So how exactly do we do that, on a scale where the tenant contains thousands of users? Opening each user account and assigning the license through the portal isn’t an option. Let’s explore the real solution.
Application
We had thousands of users, with various license plans and services already enabled. Before we could decide what needed to be set, we wanted to first understand what is set for the existing user population. Instead of reinventing the wheel here, I used a script which works pretty well. Linked below.
Overview:
Download:
https://gallery.technet.microsoft.com/scriptcenter/Export-a-Licence-b200ca2a
We ran the script, got the export, cleaned it up a bit, and then we had to do some analysis. This export however acted as the source of record for what we are setting in O365. Essentially we carved up the export into different spreadsheets, requiring one spreadsheet for each licensing configuration we wanted to assign.
Each spreadsheet will contain the UPN, License Type (AccountSkuID), and which services need to be enabled/disabled from the licenses. Again, we create a separate spreadsheets for each variation in licensing, as each licensing script will be specific to the variations we are separating out.
Once we start looking at how we are going to set licenses, and specifically at the way the cmdlet is used to configure granular license assignments, it will become clear why we break these up into separate spreadsheets. So let’s take a look at the syntax to execute these bulk assignments:
Scripting the Solution
If we want to apply the licenses to users, and enable all services with that license assignment, its pretty straight forward. Create/Modify our spreadsheet with a list of UPNs, save it in the c:\temp directory, and run the script below.
The tenant domain name referenced is the domain name associated with the tenant (tenant_domain_name.onmicroscoft.com), not the federated or shared domain name from the on premise organization.
E1 Full License:
#Bulk E1 License Assignment with no Services disabled
$AccountSkuId = "<tenant_domain_name>:STANDARDPACK"
$UsageLocation = "US"
$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId
$Users = Import-Csv c:\temp\Users.csv
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -LicenseOptions $LicenseOptions
}
E3 Full License:
#Bulk E3 License Assignment with no Services disabled
$AccountSkuId = "<tenant_domain_name>:ENTERPRISEPACK"
$UsageLocation = "US"
$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId
$Users = Import-Csv c:\temp\Users.csv
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -LicenseOptions $LicenseOptions
}
Each AccountSkuID has a corresponding value needed for this portion of the script. The options from the scripts above are:
STANDARDPACK = E1 License
ENTERPRISEPACK = E3 License
Granular Service Enablement
Now that we understand how to assign the license, what if we want to granularly control what services within the license are enabled/disabled. The answer is in the new-msollicenseoptions cmdlet, and the DisabledPlans parameter. In the script examples you’ll see below, we specify the disabledplans value, and reference that as we loop through the foreach script. This is why we broke the spreadsheet up based on license assignment. It is structured to apply a license (accountskuid) and a set of disabled plans (disabledplans parameter), to all users in a spreadsheet that we imported. The spreadsheet only needs to contain a single column with a heading of UserPrincipalName, and the corresponding list of UserPrincipalName's in the rows below it.
To the sample scripts…
E3 with only Lync Online Enabled:
#Bulk E3 License Assignment with RMS, Office Pro Plus, Office Web Apps, SharePoint Online, and Exchange Online disabled
$AccountSkuId = "<tenant_domain_name>:ENTERPRISEPACK"
$UsageLocation = "US"
$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId -DisabledPlans RMS_S_ENTERPRISE, OFFICESUBSCRIPTION, SHAREPOINTWAC, SHAREPOINTENTERPRISE, EXCHANGE_S_ENTERPRISE
$Users = Import-Csv c:\temp\Users.csv
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -LicenseOptions $LicenseOptions
}
E3 with RMS and Lync Disabled:
#Bulk E3 License Assignment with RMS and Lync Online disabled
$AccountSkuId = "<tenant_domain_name>:ENTERPRISEPACK"
$UsageLocation = "US"
$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId -DisabledPlans RMS_S_ENTERPRISE, MCOSTANDARD
$Users = Import-Csv c:\temp\Users.csv
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -LicenseOptions $LicenseOptions
}
E3 with RMS and Office Pro Plus Disabled:
#Bulk E3 License Assignment with RMS and Office Pro Plus disabled
$AccountSkuId = "<tenant_domain_name>:ENTERPRISEPACK"
$UsageLocation = "US"
$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId -DisabledPlans RMS_S_ENTERPRISE, OFFICESUBSCRIPTION
$Users = Import-Csv c:\temp\Users.csv
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -LicenseOptions $LicenseOptions
}
E1 with Exchange Online and Lync Online Disabled:
#Bulk E1 License Assignment with ExO and SpO Disabled
$AccountSkuId = "<tenant_domain_name>:STANDARDPACK"
$UsageLocation = "US"
$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId -DisabledPlans:SHAREPOINTSTANDARD,EXCHANGE_S_STANDARD
$Users = Import-Csv c:\temp\Users.csv
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -LicenseOptions $LicenseOptions
}
The only difference between the various scripts above are the AccountSkuID’s (license type), and the License Options (disabledplans parameter). Everything else remains the same. That makes these scripts a pretty good plug and play option, especially if you’re supporting an organizations that doesn’t want to standardize licensing, and requires more granular control over service enablement.
Key Options included in the Above Scripts
- DisabledPlans:
-
OFFICESUBSCRIPTION = Office 2010
MCOSTANDARD = Lync Online
SHAREPOINTWAC = SharePoint Online
SHAREPOINTENTERPRISE = SharePoint Online
EXCHANGE_S_ENTERPRISE = Exchange Online (E3)
EXCHANGE_S_STANDARD = Exchange Online (E1)
If you need to go beyond what I’ve explained in this article, I would strongly recommend reading through the link listed below. It covers a variety of options and syntax to accomplish various licensing operations.
Thanks! Hope this helps…