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 cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Exchange | Exchange Server | Management
Exchange | Exchange Server | Management
The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
Exchange | Licensing
Exchange | Licensing
The framework for legally deploying and using Microsoft Exchange Server or Exchange Online, based on server and client access models.
Exchange | Other
Exchange | Other
A powerful email and collaboration platform developed by Microsoft, designed to support enterprise-level communication and productivity. Miscellaneous topics that do not fit into specific categories.
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 123.6K 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.