Forum Discussion

JustAnotherITGuy's avatar
JustAnotherITGuy
Brass Contributor
Jan 04, 2019
Solved

Error when trying to remove a license

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:

 

 

 

 

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 https://docs.microsoft.com/en-us/powershell/module/msonline/set-msoluserlicense?view=azureadps-1.0. The error occurs on the ENTERPRISEPACK license removal - the EMS removal goes through fine.

 

 

 

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!

  • 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.

3 Replies

  • 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.

    • JustAnotherITGuy's avatar
      JustAnotherITGuy
      Brass Contributor
      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!
    • JustAnotherITGuy's avatar
      JustAnotherITGuy
      Brass Contributor

      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.

Resources