How to disable a service/s from Office 365 License via PowerShell

Last request from my customer is how to disable “Sway, Office Online and SharePoint” for Office 365 users. This is easy enough to do via the Office365 admin portal by flipping the toggles on the screen, but that obviously won’t scale.  Also, the trick is to make sure that you toggle the setting for the one service plan you are looking for while leaving all of the other service plans in their current states.

If you have multiple users and would like to run to everyone it is little bit complicated and hard to do from GUI.

Let’s start it from GUI for one user and for everyone.

First connect to Office 365 and then see what license you have


I have multiple licenses and I am particularly interested in “ENTERPRISEPREMIUM_NOPSTNCONF”

Second command I run is to set a new licensing model. I called it $NewL, and I have disabled SharePoint, Sway and Office Online products.


Once it is set, I have run it on a test user

get-msoluser -UserPrincipalName | Set-MsolUserLicense -licenseoption $NewL

Let’s see what happened

It is time to run it for everyone

Get-MsolUser -All | where {$_.isLicensed -eq $true}; $AllLicensed | foreach {Set-MsolUserLicense -LicenseOptions $NewL}

Any question, Please let us know


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

Up ↑

%d bloggers like this: