SOLVED

need to remove new O365 service in license without affecting services already in place

%3CLINGO-SUB%20id%3D%22lingo-sub-89653%22%20slang%3D%22en-US%22%3Eneed%20to%20remove%20new%20O365%20service%20in%20license%20without%20affecting%20services%20already%20in%20place%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-89653%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20mandate%20from%20my%20Director%20to%20turn%20off%20all%20new%20O365%20services%20that%20are%20released%20(if%20possible)%20at%20the%20user%20level%20so%20they%20can%20be%20turned%20on%20at%20pilot%20levels%20for%20testing%20before%20we%20make%20available%20to%20everyone.%20This%20is%20easily%20enough%20done%20by%20running%20a%20set-msoluserlicense%20script%20and%20setting%20all%20the%20disabled%20license%20options.%3C%2FP%3E%3CP%3EProblem%20comes%20in%20where%20I%20now%20have%20many%20users%20with%20enabled%20services%20(such%20as%20Teams)%20that%20the%20rest%20of%20the%2020k%2B%20mailboxes%20have%20turned%20off.%20I%20also%20have%20many%20OTHER%20users%20with%20enabled%20services%20(such%20as%20Planner%2FSway)%20enabled%20that%20everyone%20else%20has%20turned%20off.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20now%2C%20I%20have%20to%20turn%20off%20Forms.%20If%20I%20run%20through%20my%20usual%20script%20I%20am%20going%20to%20be%20turning%20off%20ALL%20services%20for%20everyone.%20I%20need%20to%20be%20able%20to%20maintain%20existing%20license%20service%20structure%20for%20users%20but%20turn%20off%20only%20FORMS%20for%20everyone.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20a%20sampling%20of%20the%20%22meat%22%20of%20what%20I'm%20running...%20please%20presume%20proper%20designations%20for%20variables%20outside%20of%20this%20sampling.%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24LicOpt%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%3D%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3ENew-MsolLicenseOptions%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-AccountSkuId%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22mytenant%3Aenterprisepack%22%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-DisabledPlans%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%E2%80%9DSWAY%E2%80%9D%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%2C%3C%2FFONT%3E%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22DESKLESS%22%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%2C%3C%2FFONT%3E%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22TEAMS1%22%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%2C%3C%2FFONT%3E%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22FORMS_PLAN_E3%22%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%2C%3C%2FFONT%3E%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22FLOW_O365_P2%22%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%2C%3C%2FFONT%3E%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22POWERAPPS_O365_P2%22%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%2C%3C%2FFONT%3E%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22PROJECTWORKMANAGEMENT%22%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3ESet-MsolUserLicense%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-UserPrincipalName%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24mbx%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-AddLicenses%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22mytenant%3AENTERPRISEPACK%22%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-LicenseOptions%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24LicOpt%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20been%20thinking%20to%20build%20an%20array%20for%20each%20user%20(though%20this%20would%20add%20considerable%20time%20to%20running%20the%20script)%2C%20pull%20their%20list%20of%20services%20and%20remove%20them%20from%20the%20list%20of%20%24LicOpt%20then%20apply.%20But%20this%20part%20of%20scripting%20eludes%20me.%20Any%20help%2Fsuggestions%2Fdirections%20to%20an%20already%20built%20wheel%20would%20be%20great%20appreciated...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-89653%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELicense%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-94247%22%20slang%3D%22en-US%22%3ERe%3A%20need%20to%20remove%20new%20O365%20service%20in%20license%20without%20affecting%20services%20already%20in%20place%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-94247%22%20slang%3D%22en-US%22%3E%3CP%3EWhile%20this%20does%20look%20good%2C%20it%20requires%20a%20level%20of%20Azure%20access%20our%20company%20does%20not%20have.%20%3A(%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-94087%22%20slang%3D%22en-US%22%3ERe%3A%20need%20to%20remove%20new%20O365%20service%20in%20license%20without%20affecting%20services%20already%20in%20place%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-94087%22%20slang%3D%22en-US%22%3E%3CP%3EHave%20you%20looked%20into%20group-based%20licensing%3F%20Almost%20everyone%20I%20show%20this%20to%20abandons%20their%20scripted%20approach%2C%20it's%20pretty%20good.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fpractical365.com%2Fblog%2Fsimplifying-office-365-license-control-azure-ad-group-based-license-management%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fpractical365.com%2Fblog%2Fsimplifying-office-365-license-control-azure-ad-group-based-license-management%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-89732%22%20slang%3D%22en-US%22%3ERe%3A%20need%20to%20remove%20new%20O365%20service%20in%20license%20without%20affecting%20services%20already%20in%20place%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-89732%22%20slang%3D%22en-US%22%3E%3CP%3ETHANK%20YOU!!!!!%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20I%20can%20work%20with%20that%20as%20a%20base!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJulie%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-89729%22%20slang%3D%22en-US%22%3ERe%3A%20need%20to%20remove%20new%20O365%20service%20in%20license%20without%20affecting%20services%20already%20in%20place%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-89729%22%20slang%3D%22en-US%22%3E%3CP%3ETake%20a%20look%20at%20this%20script%3A%20%3CA%20href%3D%22https%3A%2F%2Fblogs.technet.microsoft.com%2Fcloudpfe%2F2014%2F01%2F30%2Fhow-to-change-office-365-licenses-in-bulk-respecting-the-license-options%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fblogs.technet.microsoft.com%2Fcloudpfe%2F2014%2F01%2F30%2Fhow-to-change-office-365-licenses-in-bulk-respecting-the-license-options%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20idea%20is%20very%20similar%20to%20what%20you%20are%20asking%2C%20it%20needs%20some%20minor%20adjustments%20to%20make%20it%20work%20when%20NOT%20changing%20the%20SKU.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I have a mandate from my Director to turn off all new O365 services that are released (if possible) at the user level so they can be turned on at pilot levels for testing before we make available to everyone. This is easily enough done by running a set-msoluserlicense script and setting all the disabled license options.

Problem comes in where I now have many users with enabled services (such as Teams) that the rest of the 20k+ mailboxes have turned off. I also have many OTHER users with enabled services (such as Planner/Sway) enabled that everyone else has turned off.

 

So now, I have to turn off Forms. If I run through my usual script I am going to be turning off ALL services for everyone. I need to be able to maintain existing license service structure for users but turn off only FORMS for everyone.

 

Here is a sampling of the "meat" of what I'm running... please presume proper designations for variables outside of this sampling.

$LicOpt = New-MsolLicenseOptions -AccountSkuId "mytenant:enterprisepack" -DisabledPlans ”SWAY”,"DESKLESS","TEAMS1","FORMS_PLAN_E3","FLOW_O365_P2","POWERAPPS_O365_P2","PROJECTWORKMANAGEMENT"

Set-MsolUserLicense -UserPrincipalName $mbx -AddLicenses "mytenant:ENTERPRISEPACK" -LicenseOptions $LicOpt

 

I have been thinking to build an array for each user (though this would add considerable time to running the script), pull their list of services and remove them from the list of $LicOpt then apply. But this part of scripting eludes me. Any help/suggestions/directions to an already built wheel would be great appreciated...

4 Replies
Highlighted
Solution

Take a look at this script: https://blogs.technet.microsoft.com/cloudpfe/2014/01/30/how-to-change-office-365-licenses-in-bulk-re...

 

The idea is very similar to what you are asking, it needs some minor adjustments to make it work when NOT changing the SKU.

Highlighted

THANK YOU!!!!! :)

 

I think I can work with that as a base!

 

Julie

Highlighted

Have you looked into group-based licensing? Almost everyone I show this to abandons their scripted approach, it's pretty good.

 

https://practical365.com/blog/simplifying-office-365-license-control-azure-ad-group-based-license-ma...

Highlighted

While this does look good, it requires a level of Azure access our company does not have. :(