Feb 18 2019 04:58 PM
Hi folks!
I'm trying to remove mailboxes from users on O365.
I disabled ALL licenses on several users. Web portal showing no licenses on them.
(Get-MsolUser -UserPrincipalName <username>').licenses showing there's no licenses as well.
But when I run Disable-Mailbox <username> -IgnoreLegalHold -PermanentlyDisable
It says
Cannot Disable-Mailbox for 'John Doe' because this user has a valid license.
I tried to remove licenses via GUI and via Powershell. Result is the same.
Why is could think they have licenses?
Any Ideas ?
Feb 18 2019 11:58 PM
The Disable-Mailbox cmdlet is not supposed to be used in such scenarios - if the user is licensed, the "correct" way to deprovision the mailbox is to remove the Exchange license from it, which triggers the deprovisioning workflow.
In addition, if the mailbox was put on any type of hold (since you used the -IgnoreLegelHold parameter), removing the license automatically puts the corresponding user in an error state and halts any sync with ExODS, which probably explains why the change in license isn't being reflected on ExODS side.
Mar 09 2020 10:10 AM - edited Mar 09 2020 10:10 AM
@Andy_Bonddid you ever resolve this issue? I am having the same problem, users don't have licenses but attempting to remove the mailbox results in an error saying that they do.
Mar 09 2020 12:50 PM
@MCortezI found the issue two months later, it was retention policy, which didn't allow me to remove mailbox. I have disabled the policy and it allowed me to remove the mailbox.