In Office 365 licenses and service plans can be set by PowerShell. There are several licenses available such as "ENTERPRISEPACK" which is the code for "Office 365 Enterprise E3".

Within the enabled license of Office 365 Enterprise E3 there are several Service Plans for included products like "SharePoint Online".

I need to enable the license "ENTERPRISEPACK" for all users of the region "US" and "DE". In addition I need to activate Service Plan "SHAREPOINTENTERPRISE" (SharePoint Online (Part 2) for all of this users.

Most of them still have "ENTERPRISEPACK" enabled but do not have service pack SharePoint Online enabled.

Anyone knows how to solve this by PowerShell.

I can connect to O365 and read available Service Plans with this commandlets.

Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq “ENTERPRISEPACK”} | ForEach-Object {$_.ServiceStatus}

I finally worked out the solution for this.

First connect to Office365 via PowerShell as mentioned above.


Now set the license options you want to set. In this case the whole Office 365 E3 plan is set with all sub licenses except for ToDo, Forms, Stream, Flow and PowerApps.

$licensopt =New-MsolLicenseOptions -AccountSkuId <tenant>:ENTERPRISEPACK -DisabledPlans BPOS_S_TODO_2,FORMS_PLAN_E3,STREAM_O365_E3,FLOW_O365_P2,POWERAPPS_O365_P2

Then be aware to remove the given E3 plans from this users before you set them with exception of the mentioned sub licenses above.

Get-MsolUser -All | where{$_.UsageLocation -eq "DE" -and $_.UserPrincipalName -like "*@SomeDomain.de"} |foreach{set-msoluserLicense -UserPrincipalName $_.UserPrincipalName -RemoveLicenses "<tenant>:ENTERPRISEPACK" }

Now you can give them the license without Stream, Flow and other stuff as shown above.

Get-MsolUser -All | where{$_.UsageLocation -eq "DE" -and $_.UserPrincipalName -like "*@SomeDomain.de"} |foreach{set-msoluserLicense -UserPrincipalName $_.UserPrincipalName -RemoveLicenses "<tenant>:ENTERPRISEPACK" -LicenseOptions $licensopt }

This works fine as tested in our tenant. Please replace with your tenant identifier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.