Invalid License Error When Accessing Inactive Soft Deleted Mailboxes in Exchange Online

Shreyas Gupta 0 Reputation points
2025-01-20T12:14:58.6366667+00:00

An exception "Mailbox 'x' doesn't have a valid license" occurs while trying to access inactive soft deleted mailboxes.

A mailbox with an M365 retention policy (Purview) was deleted and converted to an inactive mailbox. It's verified that the mailbox has IsSoftDeleted and IsInactiveMailbox properties set to true in PowerShell.

However, when creating the ExchangeServiceWrapper to access the content, an internal server error arises: "The operation failed. Mailbox 'xx' doesn't have a valid license."

What could be the reason for this error? It is understood that the license gets revoked when a user is deleted, so why is there an invalid license error?

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,171 questions
Exchange Exchange Server Management
Exchange Licensing
Exchange Other
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2025-01-20T16:30:29.3233333+00:00

    You cannot access Inactive mailboxes programmatically, the only way would be via eDiscovery/Content search. Or recover/restore the inactive mailbox first: https://learn.microsoft.com/en-us/purview/restore-an-inactive-mailbox


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.