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?

Microsoft Exchange Online
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,696 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,763 questions
Microsoft Exchange
Microsoft Exchange
Microsoft messaging and collaboration software.
636 questions
Microsoft Exchange Licensing
Microsoft Exchange Licensing
Microsoft Exchange: Microsoft messaging and collaboration software.Licensing: Rules, regulations, and restrictions that define how software can be used and distributed.
31 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 111.9K Reputation points MVP
    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.