SOLVED

Error when trying to remove a license

%3CLINGO-SUB%20id%3D%22lingo-sub-308969%22%20slang%3D%22en-US%22%3EError%20when%20trying%20to%20remove%20a%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-308969%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%2C%20hoping%20for%20some%20help%20with%20this%20one.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20remove%20a%20license%20from%20a%20user%20in%20my%20tenant%3A%20o365_user1%40%3CDOMAIN%3E.com%20using%20PowerShell.%3C%2FDOMAIN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20Get-MsolUser%20I%20can%20confirm%20that%20the%20ENTERPRISE%20PACK%20(E3)%20and%20EMS%20(Enterprise%20Mobility%20%2B%20Security%20E3)%20licenses%20are%20assigned.%20I%20can%20also%20verify%20in%20the%20web%20portal.%20Not%20all%20switches%20are%20activated%20for%20the%20E3%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20835px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F64672i335BDBDBE96BAB15%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-01-04%2009_38_40-Microsoft%20365%20admin%20center%20-%20Home.png%22%20title%3D%222019-01-04%2009_38_40-Microsoft%20365%20admin%20center%20-%20Home.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20490px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F64671i4982B39C2D55926C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22e3switches.png%22%20title%3D%22e3switches.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20777px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F64670iD82B12A22FF97E13%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-01-04%2009_30_05-grrmoss21%20-%20Remote%20Desktop%20Connection.png%22%20title%3D%222019-01-04%2009_30_05-grrmoss21%20-%20Remote%20Desktop%20Connection.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%20when%20I%20run%20Set-MsolUserLicense%20to%20try%20to%20remove%20the%20license%2C%20I%20get%20an%20error%2C%20even%20though%20as%20far%20as%20I%20can%20tell%2C%20I'm%20following%20the%20correct%20syntax%20according%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmsonline%2Fset-msoluserlicense%3Fview%3Dazureadps-1.0%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft's%20documentation%3C%2FA%3E.%20The%20error%20occurs%20on%20the%20ENTERPRISEPACK%20license%20removal%20-%20the%20EMS%20removal%20goes%20through%20fine.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%201340px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F64673i851400C890C63197%2Fimage-dimensions%2F1340x131%3Fv%3D1.0%22%20width%3D%221340%22%20height%3D%22131%22%20alt%3D%22e3error.png%22%20title%3D%22e3error.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20720px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F64674iD37D5B8A74E7FFF8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-01-04%2009_39_15-Microsoft%20365%20admin%20center%20-%20Home.png%22%20title%3D%222019-01-04%2009_39_15-Microsoft%20365%20admin%20center%20-%20Home.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20this%20on%20two%20different%20accounts%20without%20success.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20think%20it's%20a%20permissions%20issue%20as%20I've%20been%20able%20to%20use%20my%20credentials%20for%20Set-MsolUserLicense%20-AddLicenses%20on%20these%20accounts.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENot%20sure%20it's%20relevant%2C%20but%20my%20long%20term%20goal%20is%20to%20pipe%20a%20CSV%20into%20a%20script%20to%20be%20able%20to%20remove%20existing%20E3%20and%20M%2BS%20licenses%20and%20replace%20with%20E1s%2FF1s%20with%20Exchange%20Online%20Plan%202%20licenses.%20I've%20got%20that%20second%20part%20working%20reliably%20in%20a%20script%2C%20but%20can't%20figure%20out%20why%20the%20license%20removal%20is%20failing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20appreciated!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-308969%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-309016%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20when%20trying%20to%20remove%20a%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-309016%22%20slang%3D%22en-US%22%3EI%20take%20it%20back...%3CBR%20%2F%3E%3CBR%20%2F%3EApparently%20removing%20the%20E3%20failed%20because%20M%2BS%20was%20depending%20on%20it.%20When%20I%20reversed%20the%20commands%20so%20that%20EMS%20was%20removed%20before%20ENTERPRISEPACK%2C%20it%20worked.%20Thanks%20for%20the%20help!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-308992%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20when%20trying%20to%20remove%20a%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-308992%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20insight.%20In%20this%20case%2C%20there%20are%20no%20other%20products%20assigned%20to%20the%20user%2C%20so%20I%20don't%20think%20that's%20the%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-308979%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20when%20trying%20to%20remove%20a%20license%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-308979%22%20slang%3D%22en-US%22%3E%3CP%3EI%20used%20to%20get%20removal%20problems%20if%20the%20user%20had%20any%20license%20that%20depended%20on%20also%20having%20Onedrive%20for%20Business%20storage.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%20removing%20E5%20with%20a%20Project%20Online.%20If%20you%20try%20to%20remove%20the%20E5%20then%20Project%2C%20that%20needs%20storage%2C%20will%20force%20an%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20something%20to%20bear%20in%20mind.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi everyone, hoping for some help with this one.

 

I'm trying to remove a license from a user in my tenant: o365_user1@<domain>.com using PowerShell.

 

Using Get-MsolUser I can confirm that the ENTERPRISE PACK (E3) and EMS (Enterprise Mobility + Security E3) licenses are assigned. I can also verify in the web portal. Not all switches are activated for the E3:

 

2019-01-04 09_38_40-Microsoft 365 admin center - Home.png

 

e3switches.png

 

2019-01-04 09_30_05-grrmoss21 - Remote Desktop Connection.png

 

However when I run Set-MsolUserLicense to try to remove the license, I get an error, even though as far as I can tell, I'm following the correct syntax according to Microsoft's documentation. The error occurs on the ENTERPRISEPACK license removal - the EMS removal goes through fine.

 

e3error.png

 

2019-01-04 09_39_15-Microsoft 365 admin center - Home.png

 

I've tried this on two different accounts without success. 

 

I don't think it's a permissions issue as I've been able to use my credentials for Set-MsolUserLicense -AddLicenses on these accounts.

 

Not sure it's relevant, but my long term goal is to pipe a CSV into a script to be able to remove existing E3 and M+S licenses and replace with E1s/F1s with Exchange Online Plan 2 licenses. I've got that second part working reliably in a script, but can't figure out why the license removal is failing.

 

Any help appreciated!

3 Replies
Highlighted
Solution

I used to get removal problems if the user had any license that depended on also having Onedrive for Business storage.

 

For example removing E5 with a Project Online. If you try to remove the E5 then Project, that needs storage, will force an error.

 

Just something to bear in mind.

Highlighted

Thanks for the insight. In this case, there are no other products assigned to the user, so I don't think that's the issue.

Highlighted
I take it back...

Apparently removing the E3 failed because M+S was depending on it. When I reversed the commands so that EMS was removed before ENTERPRISEPACK, it worked. Thanks for the help!