Microsoft Planner: Enabling the Planner license via PowerShell
Published Mar 06 2019 03:06 PM 2,673 Views
Brass Contributor

First published on MSDN on Jul 18, 2016

My earlier blog post was looking at disabling the license for Planner, while ensuring that other licenses that were already disabled didn’t get enabled as part of that process - https://techcommunity.microsoft.com/t5/planner-blog/microsoft-planner-disabling-planner-license-without-enabling/ba-p/362203  – but once you have tried Planner out and decided you do want to use it then how do I get it enabled for your users?  Thanks to Diana Balan for her help on the script.  The licensing of the plans under the Enterprise license is handled by coming up with a set of ‘disabled plans’ so the way to get Planner enabled is very similar to the way we disabled it – but we just make sure that PROJECTWORKMANAGEMENT is removed from the array of ‘disabled plans’ before applying this license option.  The same process could be used to enable any other single plan, such as Yammer or Sway.

This is my starting point – and I now want to activate Microsoft Planner.  The code is very similar to the previous blog – and again in this example I am just setting for one user – but you could loop around with some filter to set the license for multiple users.  The main change is not putting PROJECTWORKMANAGEMENT into the array to start with – and then checking that we do not add it.

$upn = “User@<tenant>.onmicrosoft.com”
$licensedetails = (Get-MsolUser -UserPrincipalName $upn ).Licenses
$ldo = @()
$licensedetails.Count;
if ($licensedetails.Count -gt 0){
foreach ($ld in $licensedetails){
if ($ld.AccountSkuId -eq “<tenant>:ENTERPRISEPACK”){
foreach ($lds in $ld.ServiceStatus){
if ($lds.ProvisioningStatus -eq “Disabled”){
if ($lds.ServicePlan.ServiceName -ne “PROJECTWORKMANAGEMENT”){
$ldo = $ldo + $lds.ServicePlan.ServiceName.ToString()

}
}
}
}
}

}

$LO = New-MsolLicenseOptions -AccountSkuId “<tenant>:ENTERPRISEPACK” -DisabledPlans $ldo
Set-MsolUserLicense -UserPrincipalName $upn -LicenseOptions $LO

 

Version history
Last update:
‎Nov 02 2020 10:37 AM
Updated by: