How to Export a List of Office 365 Service Plans
Written on December 7, 2017

When licensing Office 365 users with Windows PowerShell, you’ll potentially have a requirement to disable one or more options that comes with a particular license. For example, if a third-party email provider is in use, you may need to disable Exchange Online. This is easy in the GUI, but challenging in PowerShell.

You’ll use New-MsolLicenseOptions to create a LicenseOptions object that has all the components of your licence configured, then apply that object to the users in question. The command looks like this to assign an E3 license and disable Exchange Online:

New-MsolLicenseOptions -AccountSkuId contoso:ENTERPRISEPACK -DisabledPlans "EXCHANGE_S_ENTERPRISE"

That’s all well and good, but how do you know it’s ENTERPRISEPACK and EXCHANGE_S_ENTERPRISE? These are the internal identifiers for the E3 license and the Exchange Online service plan within the E3 license. They’re challenging (impossible?) to uncover in the GUI, but I’ve written a simple script to allow an administrator to retrieve the licenses and service plans in their tenant. This should be run from the Microsoft Online Service PowerShell.

foreach ($sku in (Get-MsolAccountSku) ) { 
  foreach ($sp in $sku.ServiceStatus) { 
    New-Object -TypeName PSObject -Property @{"AccountSkuId"=$sku.AccountSkuId;"ServicePlan"=$sp.ServicePlan.ServiceName} 
  }
}

This will output something like the following:

ServicePlan                AccountSkuId
-----------                ------------
BPOS_S_TODO_2              contoso:ENTERPRISEPACK
FORMS_PLAN_E3              contoso:ENTERPRISEPACK
STREAM_O365_E3             contoso:ENTERPRISEPACK
Deskless                   contoso:ENTERPRISEPACK
FLOW_O365_P2               contoso:ENTERPRISEPACK
POWERAPPS_O365_P2          contoso:ENTERPRISEPACK
TEAMS1                     contoso:ENTERPRISEPACK
PROJECTWORKMANAGEMENT      contoso:ENTERPRISEPACK
SWAY                       contoso:ENTERPRISEPACK
INTUNE_O365                contoso:ENTERPRISEPACK
YAMMER_ENTERPRISE          contoso:ENTERPRISEPACK
RMS_S_ENTERPRISE           contoso:ENTERPRISEPACK
OFFICESUBSCRIPTION         contoso:ENTERPRISEPACK
MCOSTANDARD                contoso:ENTERPRISEPACK
SHAREPOINTWAC              contoso:ENTERPRISEPACK
SHAREPOINTENTERPRISE       contoso:ENTERPRISEPACK
EXCHANGE_S_ENTERPRISE      contoso:ENTERPRISEPACK
BPOS_S_TODO_FIRSTLINE      contoso:DESKLESSPACK
FORMS_PLAN_K               contoso:DESKLESSPACK
STREAM_O365_K              contoso:DESKLESSPACK
FLOW_O365_S1               contoso:DESKLESSPACK
POWERAPPS_O365_S1          contoso:DESKLESSPACK
TEAMS1                     contoso:DESKLESSPACK
Deskless                   contoso:DESKLESSPACK
MCOIMP                     contoso:DESKLESSPACK
SHAREPOINTWAC              contoso:DESKLESSPACK
SWAY                       contoso:DESKLESSPACK
INTUNE_O365                contoso:DESKLESSPACK
YAMMER_ENTERPRISE          contoso:DESKLESSPACK
SHAREPOINTDESKLESS         contoso:DESKLESSPACK
EXCHANGE_S_DESKLESS        contoso:DESKLESSPACK

Here, ENTERPRISEPACK maps to an E3 license, and DESKLESSPACK maps to an F1 (formerly K1) license. As for what each service inside means? Well..you’re on your own on that. They’re often named somewhat sensibly (YAMMER_ENTERPRISE) and sometimes less so (Deskless).

Comments/questions

There's no commenting functionality here. If you'd like to comment, please either mention me (@[email protected]) on Mastodon or email me. I don't have any logging or analytics running on this website, so if you found something useful or interesting it would mean a lot to hear from you.