View Microsoft 365 licenses and services with PowerShell

This article applies to both Microsoft 365 Enterprise and Office 365 Enterprise.

Every Microsoft 365 subscription consists of the following elements:

  • Licensing plans These are also known as license plans or Microsoft 365 plans. Licensing plans define the Microsoft 365 services that are available to users. Your Microsoft 365 subscription may contain multiple licensing plans. An example licensing plan would be Microsoft 365 E3.

  • Services These are also known as service plans. Services are the Microsoft 365 products, features, and capabilities that are available in each licensing plan, for example, Exchange Online and Microsoft 365 Apps for enterprise (previously named Office 365 ProPlus). Users can have multiple licenses assigned to them from different licensing plans that grant access to different services.

  • Licenses Each licensing plan contains the number of licenses that you purchased. You assign licenses to users so they can use the Microsoft 365 services that are defined by the licensing plan. Every user account requires at least one license from one licensing plan so they can log on to Microsoft 365 and use the services.

You can use PowerShell for Microsoft 365 to view details about the available licensing plans, licenses, and services in your Microsoft 365 organization. For more information about the products, features, and services that are available in different Office 365 subscriptions, see Office 365 Plan Options.

Use the Azure Active Directory PowerShell for Graph module

First, connect to your Microsoft 365 tenant.

To view summary information about your current licensing plans and the available licenses for each plan, run this command:

Get-AzureADSubscribedSku | Select -Property Sku*,ConsumedUnits -ExpandProperty PrepaidUnits

The results contain:

  • SkuPartNumber: Shows the available licensing plans for your organization. For example, ENTERPRISEPACK is the license plan name for Office 365 Enterprise E3.

  • Enabled: Number of licenses that you've purchased for a specific licensing plan.

  • ConsumedUnits: Number of licenses that you've assigned to users from a specific licensing plan.

To view details about the Microsoft 365 services that are available in all of your license plans, first display a list of your license plans.

Get-AzureADSubscribedSku | Select SkuPartNumber

Next, store the license plans information in a variable.

$licenses = Get-AzureADSubscribedSku

Next, display the services in a specific license plan.

$licenses[<index>].ServicePlans

<index> is an integer that specifies the row number of the license plan from the display of the Get-AzureADSubscribedSku | Select SkuPartNumber command, minus 1.

For example, if the display of the Get-AzureADSubscribedSku | Select SkuPartNumber command is this:

SkuPartNumber
-------------
WIN10_VDA_E5
EMSPREMIUM
ENTERPRISEPREMIUM
FLOW_FREE

Then the command to display the services for the ENTERPRISEPREMIUM license plan is this:

$licenses[2].ServicePlans

ENTERPRISEPREMIUM is the third row. Therefore, the index value is (3 - 1), or 2.

For a complete list of license plans (also known as product names), their included service plans, and their corresponding friendly names, see Product names and service plan identifiers for licensing.

Use the Microsoft Azure Active Directory Module for Windows PowerShell

First, connect to your Microsoft 365 tenant.

Note

A PowerShell script is available that automates the procedures described in this topic. Specifically, the script lets you view and disable services in your Microsoft 365 organization, including Sway. For more information, see Disable access to Sway with PowerShell.

To view summary information about your current licensing plans and the available licenses for each plan, run the following command:

Get-MsolAccountSku

Note

PowerShell Core does not support the Microsoft Azure Active Directory Module for Windows PowerShell module and cmdlets with Msol in their name. To continue using these cmdlets, you must run them from Windows PowerShell.

The results contain the following information:

  • AccountSkuId: Show the available licensing plans for your organization by using the syntax <CompanyName>:<LicensingPlan>. <CompanyName> is the value that you provided when you enrolled in Microsoft 365, and is unique for your organization. The <LicensingPlan> value is the same for everyone. For example, in the value litwareinc:ENTERPRISEPACK, the company name is litwareinc, and the licensing plan name ENTERPRISEPACK, which is the system name for Office 365 Enterprise E3.

  • ActiveUnits: Number of licenses that you've purchased for a specific licensing plan.

  • WarningUnits: Number of licenses in a licensing plan that you haven't renewed, and that will expire after the 30-day grace period.

  • ConsumedUnits: Number of licenses that you've assigned to users from a specific licensing plan.

To view details about the Microsoft 365 services that are available in all of your license plans, run the following command:

Get-MsolAccountSku | Select -ExpandProperty ServiceStatus

The following table shows the Microsoft 365 service plans and their friendly names for the most common services. Your list of service plans might be different.

Service plan Description
SWAY
Sway
TEAMS1
Microsoft Teams
YAMMER_ENTERPRISE
Yammer
RMS_S_ENTERPRISE
Azure Rights Management (RMS)
OFFICESUBSCRIPTION
Microsoft 365 Apps for enterprise (previously named Office 365 ProPlus)
MCOSTANDARD
Skype for Business Online
SHAREPOINTWAC
Office
SHAREPOINTENTERPRISE
SharePoint Online
EXCHANGE_S_ENTERPRISE
Exchange Online Plan 2

For a complete list of license plans (also known as product names), their included service plans, and their corresponding friendly names, see Product names and service plan identifiers for licensing.

To view details about the Microsoft 365 services that are available in a specific licensing plan, use the following syntax.

(Get-MsolAccountSku | where {$_.AccountSkuId -eq "<AccountSkuId>"}).ServiceStatus

This example shows the services that are available in the litwareinc:ENTERPRISEPACK (Office 365 Enterprise E3) licensing plan.

(Get-MsolAccountSku | where {$_.AccountSkuId -eq "litwareinc:ENTERPRISEPACK"}).ServiceStatus

See also

Manage Microsoft 365 user accounts, licenses, and groups with PowerShell

Manage Microsoft 365 with PowerShell

Getting started with PowerShell for Microsoft 365