Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 55
  • Last Modified:

Remove Planner for ALL users in Tenant

I need to remove ALL users without the need of a csv that currently have a PLANNERSTANDALONE license.

Does someone have a powershell script to do just this?

Thanks

John
0
John Davies
Asked:
John Davies
1 Solution
 
Vasil Michev (MVP)Commented:
It's not as easy as you might have a combination of SKUs all eligible for Planner. In general, you should be able to use this to list the relevant SKUs:

Get-MsolAccountSku | ? {$_.ServiceStatus.ServicePlan.ServiceName -eq "PROJECTWORKMANAGEMENT"}

Open in new window


Once you have the SKU(s), for each run:

$SkuOptions = New-MsolLicenseOptions -AccountSkuId "SKU_from_above" -DisabledPlans "PROJECTWORKMANAGEMENT"

Open in new window


Lastly, replace the current license:

Get-MsolUser | ? {$_.Licenses.AccountSkuId -eq "SKU_from_above"} |  % { Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -LicenseOptions $SkuOptions }

Open in new window


Repeat for any additional SKUs.

And goes without saying, test with a single user or two before running this against the whole tenant.
0
 
John DaviesAuthor Commented:
Bang on Vasil - Thank you
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now