Disabling Office 365 Planner Using PowerShell

Office 365 Planner is now rolling out to your tenant.  Microsoft announced this week that Planner is ready for showtime. As this is a product early in its life cycle, Microsoft is still looking for feedback through the Planner uservoice site. Over the next several weeks, Planner will roll out to all eligible Office 365 customers worldwide. At this time, Planner is included with:

  • Office 365 Enterprise (E1, E3, E4, and E5)
  • Office 365 Education (E1, E3, E4, and E5)
  • Office 365 Business Essentials
  • Office 365 Business Premium.

Microsoft Planner will not be available to users by default in the General Availability (GA) update in the following subscription plans:

  • Office 365 operated by 21Vianet
  • Office 365 Government

An important thing to note with this release…

Each user who has one of the Office 365 plans mentioned above has a Microsoft Planner license that is enabled by default.

If your enterprise is not ready, an admin can add or remove licenses for individual users, or to disable Planner to all users. I put a script together that you can run to disable Planner for all licensed users in your tenant.  This script will:

  1. Disable any plan entered into the $disabledplans variable, by default it is just Planner (PROJECTWORKMANAGEMENT)
  2. Disable the Planner Preview SKU if it was assigned
  3. ***Reassign all other services not declared as being disabled.*** <- important  
    • Add any other services you want to disable in the $disabledplans variable (i.e. YAMMER_ENTERPRISE)

Thanks to @vladcatrinescu and his script on disabling Yammer as a starting point


3 Comments

  • Ron

    August 25, 2016

    Thank you this worked. Now that planner is disabled, how can I re-enable planner through powershell?

    Reply
  • Ryan Bahm

    September 2, 2016

    The posted script may cause problems if you don’t want all other licenses enabled on SKUs that contain planner. I made some modifications to the script to yield a more usable example:

    #MAKE SURE YOU ARE CONNECTED TO OFFICE 365 BEFORE RUNNING THIS SCRIPT
    #If you don’t know how check out: http://powershell.office.com/script-samples/connect-to-Azure-AD
    #The initial script was built for Yammer removal by Vlad Catrinescu and can be found here: http://spvlad.com/1VXll7f
    #Updated by Drew Madelung to support O365 Planner GA
    #This script will go through all licensed users and first check if they have the planner preview license and remove it and then check for the GA O365 planner license and disable it
    #This script will re-enable all other services EXCEPT planner, If you want to disable more add them comma seaparated to the $disabledplans variable.
    #For example to disable Yammer and Planner use this: $disableplans = “PROJECTWORKMANAGEMENT”, “YAMMER_ENTERPRISE”

    #Set disabled plans (only Planner to start)
    $disableplans = “PROJECTWORKMANAGEMENT”

    #Get All Licensed Users
    #$users = Get-MsolUser -All | ? UserPrincipalName -notlike “s-*” | Where-Object {$_.isLicensed -eq $true} | Get-Random -count 5
    $users = Get-MsolUser -MaxResults 50 | ? UserPrincipalName -notlike “s-*” | Where-Object {$_.isLicensed -eq $true} | Get-Random -count 5

    Write-Host (“Chose {0}.” -f $Users.UserPrincipalName)
    #$Users = get-msoluser -UserPrincipalName jfraguela@lwsd.org

    foreach ($user in $users)
    {
    Write-Host “Checking ” $user.UserPrincipalName -foregroundcolor “Cyan”
    $CurrentSku = $user.Licenses.Accountskuid
    #If more than one SKU, Have to check them all!
    if ($currentSku.count -gt 1)
    {
    Write-Host $user.UserPrincipalName “Has Multiple SKU Assigned. Checking all of them” -foregroundcolor “White”
    for($i = 0; $i -lt $currentSku.count; $i++)
    {
    #Disable preview planner if it is assigned to this user
    if($currentSku[$i] -like “*PLANNERSTANDALONE*” )
    {
    $pos = $currentSku[$i].IndexOf(“:”)
    $tenant = $currentSku[$i].Substring(0, $pos)
    $license = $tenant + “:PLANNERSTANDALONE”
    Write-host $user.Licenses[$i].AccountSkuid “has Planner Preview. Will Disable for” $tenant -foregroundcolor “Yellow”
    Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -RemoveLicenses $license
    Write-Host “Planner Preview disabled for ” $user.UserPrincipalName ” On SKU ” $user.Licenses[$i].AccountSkuid -foregroundcolor “Green”
    }
    else
    {
    #Loop trough Each SKU to see if one of their services has the word PROJECTWORKMANAGEMENT inside. This is the service for O365 Planner
    if($user.Licenses[$i].ServiceStatus.ServicePlan.ServiceName -like “*PROJECTWORKMANAGEMENT*” )
    {
    Write-host $user.Licenses[$i].AccountSkuid “has Planner. Will Disable” -foregroundcolor “Yellow”

    $ToDisableForThisUser = New-Object System.Collections.ArrayList
    $ToDisableForThisUser.Add($disableplans) | Out-Null

    foreach ($UserSKU in $user.Licenses[$i].ServiceStatus)
    {
    if($UserSKU.ProvisioningStatus -eq “Disabled”)
    {
    $ToDisableForThisUser.Add($UserSKU.ServicePlan.ServiceName) | Out-Null
    }
    }

    $NewSkU = New-MsolLicenseOptions -AccountSkuId $user.Licenses[$i].AccountSkuid -DisabledPlans ($ToDisableForThisUser.ToArray())
    Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -LicenseOptions $NewSkU
    Write-Host “Planner disabled for ” $user.UserPrincipalName ” On SKU ” $user.Licenses[$i].AccountSkuid -foregroundcolor “Green”
    }
    else
    {
    Write-host $user.Licenses[$i].AccountSkuid ” doesn’t have Planner. Skip” -foregroundcolor “Magenta”
    }
    }
    }
    }
    else
    {
    $ToDisableForThisUser = New-Object System.Collections.ArrayList
    $ToDisableForThisUser.Add($disableplans) | Out-Null

    foreach ($UserSKU in $user.Licenses.ServiceStatus)
    {
    if($UserSKU.ProvisioningStatus -eq “Disabled”)
    {
    $ToDisableForThisUser.Add($UserSKU.ServicePlan.ServiceName) | Out-Null
    }
    }

    $NewSkU = New-MsolLicenseOptions -AccountSkuId $CurrentSku -DisabledPlans ($ToDisableForThisUser.ToArray())
    Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -LicenseOptions $NewSkU
    Write-Host “Planner disabled for ” $user.UserPrincipalName -foregroundcolor “Green”
    }
    }

    Reply
    • Drew Madelung

      September 14, 2016

      Thanks Ryan!!

      Reply

Leave a Reply