

- #How to remove office 365 license powershell how to
- #How to remove office 365 license powershell windows
The example script below disables the Flow and PowerApps licenses for all users in a tenant. This can sound intimidating, but it’s really not terribly difficult as far as PowerShell scripts go. A better option would be to set the license options with a PowerShell script. If you have a large number of users this is very tedious to do this through the admin center screens. You will need to unassign the license option for each user. If you want to turn off one or more products there is no global ‘off switch’. If you make a product available you will need to provide training, support, administration, setup, security and so forth. The license options available for my Office 365 developer tenant are shown below.Įven though you are licensed for all of those products, your organization will need to determine which products will be available to your users. Your tenant administrator can view these options in the Office 365 admin center. If you assign one of these licenses to a user in your organization, by default they will receive all of the Office 365 products (called license options) associated with the product.įor example an E3 license will include Exchange, SharePoint, OneDrive, Yammer, Planner, Sway, Flow, PowerApps, StaffHub, etc. When you sign up for Office 365 you will select a plan such as E1 or E3. This function creates a custom object that can store the name of the license (AccountSkuID), how many licenses are available in your Office 365 tenant (ActiveUnits), how many licenses are already assigned to users (ConsumedUnits), how many licenses are still available (RemainingUnits) and which users these licenses were assigned to (Users).įor every item in $MsolAccountSkus, I collect the information, create the new custom object, and store it in $O365_Licenses.As part of planning a rollout of Office 365 to your organization you should decide which Office 365 products you will be part of your service offering. $Object | add-member Noteproperty Users $Users $Object | add-member Noteproperty RemainingUnits $RemainingUnits $Object | add-member Noteproperty ConsumedUnits $ConsumedUnits $Object | add-member Noteproperty ActiveUnits $ActiveUnits

$Object | add-member Noteproperty AccountSkuID $AccountSkuID FUNCTION O365_License_Object($AccountSkuID, $ActiveUnits, $ConsumedUnits Those objects are then stored in the array $O365_Licenses. I decided to collect every piece of information that I needed and store it in a custom object. There are many different ways to achieve what I was looking for. $MsolAccountSkus and $LicesedMsOnlineUsers are basically what you can see in a user’s license overview of the Office 365 portal. $MsolAccountSkus is an array of objects that contains information about every available license, such as ID, how many licenses were consumed and how many are still available. I also want to know all users that consume licenses: $LicensedMsOnlineUsers = Get-MsolUser | Where-Object The first thing I want to know is how many Office 365 licenses are available: $MsolAccountSkus = Get-MsolAccountSku

Once you’ve installed these tools, you can connect to your tenant: Connect-MsolServiceĪfter providing your credentials, you can get and modify information about your Office 365 users.
#How to remove office 365 license powershell how to
You can find more information about how to use PowerShell in your Office 365 tenant here.
#How to remove office 365 license powershell windows
