You can manage Office 365 licenses in the Admin Center. However, in large organizations, you have to automate Office 365 licensing with PowerShell.

Baki Onur Okutucu

Onur is a subject matter expert for Office 365, Azure, and PowerShell technologies. He is the founder of Clouderz Ltd, a cloud consultancy based in London. For eight years in a row, Microsoft has recognized him as a Most Valuable Professional. You can follow Onur on Twitter: @BakiOnur.

Latest posts by Baki Onur Okutucu (see all)

Office 365 has a wide range of subscription models. Some are designed for end users, while some are particularly suitable for businesses. Each subscription model has its own service plans, such as email, IM, storage, and so on. This makes Office 365 pretty flexible.

Managing Office 365 subscriptions in the Admin Center ^

There are several ways to manage Office 365 tenants. Office 365 consists of certain types of services such as Exchange Online, SharePoint Online, Skype for Business, and many more. For each service, a specific administration console exists. The Office 365 Admin Center represents services as tiles.

Office 365 Portal homepage

Office 365 Portal homepage

The available tiles can vary and relate to your license. Accounts with administrative access to Office 365 can use the Admin tile (hidden to standard users) to manage Office 365 tenants. User not allowed to use a particular service won't see the corresponding tile.

Listing current licenses and subscriptions in the Office 365 Admin Center

Listing current licenses and subscriptions in the Office 365 Admin Center

In the Office 365 Admin Center, you will find Licenses in the Billing section. Here, you can manage the license numbers along with the corresponding subscriptions as the screenshot above shows. The Name column here represents subscription names. For more subscription-related actions such as credit checks, renewals, payment details, and adding new subscriptions to the tenant, you have to navigate to the Subscription section.

Managing Office 365 with PowerShell ^

PowerShell is an effective alternative to the Office 365 web portal to manage Office 365. To use it, you first have to install the Office 365 PowerShell module. There are two ways to accomplish this task.

The easiest way is just to open a PowerShell console and install the module from the PowerShell Gallery (PSGallery) using this command:

Installing the MSOnline module from PSGallery

Installing the MSOnline module from PSGallery

Another option is to download and install the Azure Active Directory PowerShell module, because the MSOnline module is a component of the Azure module.

After you install the module, you have to import it with the Import-Module cmdlet.

Importing the MSOnline module

Importing the MSOnline module

To make sure it all went well, you can list the cmdlets of the MSOnline module with the command below:

Listing Office 365 cmdlets

Listing Office 365 cmdlets

This command returns all MSOnline module cmdlets. You can also list the number of cmdlets in the module with this command:

Total count of Office 365 cmdlets

Total count of Office 365 cmdlets

Now we are ready to manage Office 365 licenses with PowerShell. First, let's list all subscriptions by using the Get-MsolSubscription cmdlet:

Listing Office 365 subscriptions along with the number of licenses

Listing Office 365 subscriptions along with the number of licenses

The SkuPartNumber column shows the subscriptions (also known as license bundles) that the organization has already bought and that are ready for assignment. These subscription names are not really user friendly. The table below lists the corresponding descriptions.

AccountSkuIDDescription
BI_AZURE_P1Power BI (Business Intelligence) Reporting and Analytics
CRMIURCustomer Relationship Management Internal Use Rights
DESKLESSPACKOffice 365 (Plan K1)
DESKLESSWOFFPACKOffice 365 (Plan K2)
DEVELOPERPACKOffice 365 For Developers
ECAL_SERVICESEnterprise Client Access Services
EMSEnterprise Mobility Suite
ENTERPRISEPACKEnterprise Plan E3
ENTERPRISEPACK_B_PILOTOffice 365 (Enterprise Preview)
ENTERPRISEPACK_FACULTYOffice 365 (Plan A3) for Faculty
ENTERPRISEPACK_STUDENTOffice 365 (Plan A3) for Students
ENTERPRISEPACKLRGEnterprise Plan E3
ENTERPRISEWITHSCALEnterprise Plan E4
ENTERPRISEWITHSCAL_FACULTYOffice 365 (Plan A4) for Faculty
ENTERPRISEWITHSCAL_STUDENTOffice 365 (Plan A4) for Students
EXCHANGESTANDARDOffice 365 Exchange Online Only
INTUNE_AWindows Intune Plan A
LITEPACKOffice 365 (Plan P1)
MCOMEETADVPublic switched telephone network (PSTN) conferencing
PLANNERSTANDALONEPlanner Standalone
POWER_BI_ADDONOffice 365 Power BI Add-on
POWER_BI_INDIVIDUAL_USEPower BI Individual User
POWER_BI_PROPower-BI Professional
POWER_BI_STANDALONEPower BI Standalone
POWER_BI_STANDARDPower-BI Standard
PROJECTCLIENTProject Professional
PROJECTESSENTIALSProject Lite
PROJECTONLINE_PLAN_1Project Online
PROJECTONLINE_PLAN_2Project Online (and Professional Version)
RIGHTSMANAGEMENT_ADHOCWindows Azure Rights Management
SHAREPOINTSTORAGESharePoint storage
STANDARD_B_PILOTOffice 365 (Small Business Preview)
STANDARDPACKEnterprise Plan E1
STANDARDPACK_FACULTYOffice 365 (Plan A1) for Faculty
STANDARDPACK_STUDENTOffice 365 (Plan A1) for Students
STANDARDWOFFPACKOffice 365 (Plan E2)
STANDARDWOFFPACKPACK_FACULTYOffice 365 (Plan A2) for Faculty
STANDARDWOFFPACKPACK_STUDENTOffice 365 (Plan A2) for Students
VISIOCLIENTVisio Pro Online

With the help of the Get-MsolAccountSku cmdlet, you can get a breakdown of your subscriptions including active, warning, and consumed licenses.

Detailed view of current licenses

Detailed view of current licenses

Assign licenses to users ^

You can assign licenses through the Office 365 Admin center. However, it might be a bit inconvenient to sign in and navigate to the licensing section every time you have to manage licenses. With PowerShell, you will usually be faster.

First, you may need to list all users with no licenses so that you can consider assigning licenses to users who need access to services:

Listing Office 365 users without assigned licenses

Listing Office 365 users without assigned licenses

To assign a license to a user, we need to specify the UserPrincipalName attribute of the user and also an isLicensed name. In my example, I assigned a DEVELOPERPACK license to the user.

Assigning a new license to a user

Assigning a new license to a user

You can get a list of your available licenses via the Get-MsolAccountSku cmdlet as mentioned above.

Each license includes service plans. The following command returns all service plans for a license along with the provisioning status.

In this case, the user onur1@clouderz.com has a DEVELOPERPACK license. To list all service plans of the user's license, you can run the following command:

Listing all service plans of a user license

Listing all service plans of a user license

The ProvisioningStatus column shows the status of a specific service plan. You can easily restrict the service plans available to a specific user.

Customize service plans for users ^

You may only want a user to make use of some specific services (service plans) that a license consists of. First, you have to create a license option and then assign this option to a user. You can use license options to customize a license with desired service plans.

In my example, I will customize a DEVELOPERPACK license without the EXCHANGE_S_ENTERPRISE service plan and then assign it to a user. Let's take a look at the service plans available in a DEVELOPERPACK license.

Listing all available service plans of a license

Listing all available service plans of a license

The following command creates a new license option with a disabled EXCHANGE_S_ENTERPRISE service:

Next, let's assign this custom service plan to the user with the following command;

Customizing service plans for a specific user

Customizing service plans for a specific user

We have thus now configured the user to use all services defined in the license except for the Exchange mailbox.

Create an organization-wide license report ^

It is crucial to manage Office 365 licenses proactively. Large organizations assign and take back licenses every day. Therefore, it is important to ensure that you never run out of licenses. With the simple PowerShell script below, you can create a license report as a CSV file:

License table with the available number of licenses

License table with the available number of licenses

The script below creates a corresponding HTML report and sends it to the specified email address in the last command:

HTML report of the available Office 365 licenses

HTML report of the available Office 365 licenses

Conclusion ^

If you work in an organization with many users, PowerShell is the only way to manage Office 365 licensing in a timely manner. I hope the scripts introduced in this post will help you to get started.

Win the monthly 4sysops member prize for IT pros

Share
7+

Users who have LIKED this post:

  • avatar

Related Posts

9 Comments
  1. Alan Birch 8 months ago

    I run a tenant at a school and resisted PowerShell but the changes in the admin centre make that futile. Problem is I don't know what I'm doing so the risk of stuffing it up is great. I have cobbled together the following script from various sources on the internet for adding licences:

    Year09 is our new intake for this year. We use the Department field in AD so that we can more easily find the set of students to work on. There are usually 500 new students.

    This works but if I ever have to change those licences, say adding Yammer, I'd be stuck. Also, it's already out of date since MS have added in a new service plan named StaffHub (don't know why that's in the student licence though), so I'll need to find out it's system name and change the -DisbledPLans part of the script to exclude this.

    You PS experts can probably pick holes in this script. Please do; maybe it can be improved and prove useful to others. Be nice to combine the 2 ForEach lines into one for example.

    0

  2. Author
    Baki Onur Okutucu 8 months ago

    Hi Alan,

    First, thank you for pointing out how crucial Service Plan SKU  names are.

    You can get a full list of all service plans with their system names available in your subscriptions using this command;

    or;

    Also regarding to your question, StaffHub currently appears as "Deskless".

    1+

  3. Author
    Baki Onur Okutucu 8 months ago

    Hi Alan,

    I've combined the lines you shared, so you can use the one below instead.

    $Options = New-MsolLicenseOptions -AccountSkuId nameofscholnz:STANDARDWOFFPACK_IW_STUDENT -DisabledPlans YAMMER_EDU, MCOSTANDARD, OFFICE_FORMS_PLAN_2, PROJECTWORKMANAGEMENT, FLOW_O365_P2, POWERAPPS_O365_P2, RMS_S_ENTERPRISE
    Get-MsolUser -Department Year09 | Where-Object {$_.isLicensed -ne $true} | ForEach-Object{
    Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation NZ
    Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses nameofschoolnz:STANDARDWOFFPACK_IW_STUDENT -LicenseOptions $Options
    }

    1+

  4. Alan Birch 8 months ago

    Hi Baki,

    I've added your improved version of the script into my collection and added DESKLESS into the disabled plans section. I've also learned something along the way - always a bonus.

    Thanks,

    Alan.

    0

  5. Shreya 7 months ago

    Hi Alan,

    Is it possible to disable a service for all the unassigned E3 licenses of a tenant? Basically I need to customize the E3 licenses of my tenant so that whenever they are assigned to a user some services are disabled before hand. I don't need to assign licenses now

    0

  6. Author
    Baki Onur Okutucu 7 months ago

    Hi Shreya,

    You can customize a powershell script defining undesired services in advance and then use that script with required inputs when you need to assign licenses to users.

    Otherwise, there is no licensing templates that you can customize over O365 portal for future needs. If none of the services in a certain subscription are disabled that must mean that all of the services are enabled. Actually, this post helps you create your custom license subscriptions playing with service plans while assigning licenses to users.

    0

  7. Pat Richard 7 months ago

    E5 licenses are not in the list above. They are 'EnterprisePremium'

    0

  8. Florent 3 months ago

    Hello !

    Great post !

    Do I have a way to remove all licenses but one specific from a user ? When we off board people we remove all the licenses but the Enterprise E2. I didn't find how to do that with Powershell.

    Thanks

    0

  9. Author
    Baki Onur Okutucu 2 months ago

    Hi Florent,

    Here is what you want.

    This script removes all Licences but one specific license from a specific user.

    You just define what to keep then the script takes care of the rest

    Don't forget to change first 3 lines

    thx

    Onur

    ### CHANGE HERE ###
    $tenantID="domain" #Change this to your organization's TenantID
    $UPN="user1@domain.com" #Change this to your user's UPN
    $LicenseSKUID="EMS" #The License that you want to KEEP, in your case it should be STANDARDWOFFPACK for E2
    ###################

    ### DO NOT CHANGE HERE ###
    $userskus=(Get-MsolUser -UserPrincipalName $UPN).Licenses.accountskuid

    $userskus | foreach{

    if(!($_ -eq "$tenantID"+":"+"$LicenseSKUID")){

    Set-MsolUserLicense -UserPrincipalName $UPN -removelicenses $_

    }

    }

    ### END SCRIPT ###

    0

Leave a reply

Your email address will not be published. Required fields are marked *

*

CONTACT US

Please ask IT administration questions in the forum. Any other messages are welcome.

Sending
© 4sysops 2006 - 2017

Log in with your credentials

or    

Forgot your details?

Create Account