Turn off O365 licenses for all users

Hello All,

If you need to turn off O365 licenses for all users currently using an Office 365 E3, E5 subscription plan or etc, you can go through the following steps to disable some plans that you do not wish for them to use. For example, if you want to assign O365 to all your users, but your not comfortable deploying Yammer yet, you can disable the Yammer subscription for all users at once. Another scenario is if Microsoft enables new features in your tenant such as Flow, Microsoft Teams, or Dynamics, you can follow the steps below to remove them from all users.

*Note: Do not run these steps if all your users do not have the same licenses applied. For example if you have some users using Skype for Business but not all of your E3 users are, this will not work for you. The cmdlet below will make changes for All users with that license pack subscribed.*

  1.  Get your license account SKU.
    1. Get-msolaccountSku
  2. Collect a list of users with a license and place them in a variable.
    1. $AllLicensed = Get-MsolUser -All | where {$_.isLicensed -eq $true}
  3. Verify your list.
    1. $AllLicensed
  4. Get a list of license currently assigned and disabled for your users.
    1. (Get-MsolUser -UserPrincipalName user@domain.com).Licenses[0].ServiceStatus
  5. Create a variable of the subscriptions with the disabled plans. Insert the Sku from step2, and replace Domain:enterpisepack with your exact subscription name. Be sure to leave the quotes. If your licenses are named differently you can get the accurate names from step 5.
    1. $LO = New-MsolLicenseOptions -AccountSkuId "[Domain:EnterprisePack]" -DisabledPlans "FLOW_O365_P2", "POWERAPPS_O365_P2", "TEAMS1"
  6. Run the script to update the plans. This script will count out each user in progress.
    1. $AllLicensed | foreach {$i; get-msoluser -userprincipalname $_.userprincipalname | Set-MsolUserLicense -LicenseOptions $LO; $i++}
  7. Verify plans have changed. Spot check for a few users, or you can customize a script to output everyone to a CSV.
    1. (Get-MsolUser -UserPrincipalName user@domain.com).Licenses[0].ServiceStatus

 

If you follow the steps correctly, the plans should be disabled for your users. I do recommend testing the new features, as Stream and Teams seem to be nice new features that I use, however I can understand that for security reasons, these need to be investigated prior to releasing to your employees.

-Dom