SOLVED

Error when trying to remove a license

Brass 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
best response confirmed by JustAnotherITGuy (Brass Contributor)
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.

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.

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!
1 best response

Accepted Solutions
best response confirmed by JustAnotherITGuy (Brass Contributor)
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.

View solution in original post