O365 - Unassign service within enterprise license

In Office 365, Microsoft Teams is included in the E1, E3 and E5 licenses by default.

I only want to enable Microsoft Teams for a certain subset of employees until we have a better understanding and can manage it before allowing the entire company to use it.

1. Does anyone have a powershell script to unassigned the Microsoft Teams feature for all O365 users, leaving all other licenses in tack?
2. Once unassigned, is there another command to enable the Microsoft Teams feature for those few users we select to test with?

Thanks in advance.
Christian HansAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Over the past year or so I have used a few methods all based around on-prem AD group membership for licensing the various features.

I started with the PowerShell using the MSOL cmdlets to manage this and am now using the Azure Graph API via PowerShell to do this, but it is all part of a much larger identity management solution so I can't really put it up here. That said, Microsoft have recently introduced licensing templates for O365. Check out:


I think this will natively in O365 achieve what you are looking to do. I certainly wish this was around at the start, but our solutions are now well entrenched to change.
Vasil Michev (MVP)Commented:
Group-based licensing requires Azure AD Premium subscription though, so it's not ideal solution.

@Christian, the steps are pretty much the same as with disabling any other service(s). Here's an example:

$licenseplan =  New-MsolLicenseOptions -AccountSkuId "tenant:ENTERPRISEPACK" -DisabledPlans "TEAMS1"
Get-MsolUser | ? {$_.Licenses.AccountSkuId -eq "tenant:ENTERPRISEPACK"} | Set-MsolUserLicense -LicenseOptions $licenseplan

Open in new window

That's assuming users already have the corresponding E3 license. You will have to repeat the same for E1/E5, by replacing the SKU above.

Enabling is similar, just refresh the LicenseOptions with Teams enabled.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Group-based licensing requires Azure AD Premium subscription though, so it's not ideal solution.

Azure AD is only required during preview, and you can just spin up a trial to play with in the mean time (Worst case you're looking at $1/month for an Azure  AD Basic subscription). But yes right now you do need AAD, though it will be opened to Enterprise E3 subscriptions too without needing an Azure AD subscription when it goes general availability which won't be too far off.
Todd NelsonSystems EngineerCommented:
Review this article for granularly assigning license options.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.