Microsoft Planner:Disabling Planner license without enabling other licenses

One question that comes up around license management for Office 365 is that it is tricky to disable licenses for many users if you don’t know which other licenses they already have active or disabled.  This can get particular tricky when some licenses are mutually exclusive, and here the ones that come to mind for Project Online customers are the Office Online and SharePoint Online (Plan 2) – as these are also present in my Project Online plan, as well as seen here in my Office 365 Enterprise E3 – so can only be turned on in one plan or the other (it doesn’t matter which).

*** Update 7/18 – and when you do want to activate again – the script can be found here ***



As I mentioned before – certainly not trying to discourage use of Microsoft Planner – it is a great tool – but want to be sure you have the tools to be able to manage in in your tenants.

If I want to disable Planner I can use the PowerShell command to set a LicenseOption and set PROJECTWORKMANAGEMENT as a disabled plan.  If I just set this as disabled though – it would enable all the other items – and it would actually fail in the above scenario as it could not enable Office Online and SharePoint Online (Plan 2) due to the conflict.  Also what if I had thousands of users and each had a different set of enabled and disabled items (This would not be a good idea – and I’d suggest you probably should have a few standard sets of enabled items covering all your users)?  But these things happen…  I played around with PowerShell and found the following solution.  This is hardcoded to add Planner, but you could just as easily take a parameter in.  It is also hard-coded to my Office 365 Enterprise – but could easily be adapted for other scenarios.

*** Update 7/5/2016 – Thanks to Ryan Cook for bringing this to my attention – but any plans (in the Office 365 licensing sense of the word) that show as ‘Pending Activation’ will also be enabled as part of this process – as they are not listed as disabled already.  If you do not want to enable these (take a look before running any updates) then you could add them to the $ldo below so they will then be disabled. ***

I’ll walk you through the code:

# First I connect to my service and log in at the prompt


# I’ve hard coded just one user for my tests – but you could loop (I’ll leave you to get the setting of the variables scoped correctly…)

$upn = “user@<tenant>”
# I get the current licenses (this pulls the top level, like Office 365 Enterprise, Project Online etc.

$licensedetails = (Get-MsolUser -UserPrincipalName $upn ).Licenses
# I will be using an array to pull all of my disabled plans together – and I start with the new one I want to disable

$ldo = @()
# Making sure there are some licenses
if ($licensedetails.Count -gt 0){
foreach ($ld in $licensedetails){
# I’m only interested in the ENTERPRISEPACK – edit the next line with your tenant

if ($ld.AccountSkuId -eq “<tenant>:ENTERPRISEPACK”){
foreach ($lds in $ld.ServiceStatus){
if ($lds.ProvisioningStatus -eq “Disabled”){
# I’m looking for ones that are already disabled and adding them to my array

$ldo = $ldo + $lds.ServicePlan.ServiceName.ToString()

# I then create a new license option – and set the DisabledPlans to my array – Planner plus the others it finds

$LO = New-MsolLicenseOptions -AccountSkuId “<tenant>:ENTERPRISEPACK” -DisabledPlans $ldo

# Finally I set the license option for my selected user – disabling Planner in this case, as well as keeping Yammer, Office Online and SharePoint Online (Plan 2) disabled.
Set-MsolUserLicense -UserPrincipalName $upn -LicenseOptions $LO

Take care if copying the above – WordPress can add some curly quotes – and my lines may not be wrapped correctly.

Once this executes I take a look at my licenses – and Planner is disabled!  All others are as they were!


And a reminder – disabling Planner license will not stop a user from accessing if they already know the shortcut or have a link.