Forum Discussion
How to fetch Soft Deleted mailboxes with are NOT Inactive?
I'm trying to connect Soft Deleted mailboxes using EWS Managed API and observed following behaviour when deleted:
- Has M365 retention policy applied pre deletion -> Removed M365 user account -> Mailbox soft deleted and converted to inactive mailbox.
- Has no M365 retention policy applied pre deletion -> Removed M365 user account -> Mailbox soft deleted but doesn't get converted to inactive mailbox.
As per my understanding, mailbox data is retained for 30 days after the account is removed irrespective of the fact that if it is an inactive mailbox or not. I'm able to fetch root folder for Inactive soft deleted mailbox using ExchangeService instance, but for soft deleted mailbox which is NOT inactive, I'm getting error 'ErrorNonExistentMailbox: The SMTP address has no mailbox associated with it'.
How can we fetch soft deleted mailbox root which is NOT inactive? In other words how can we fetch soft deleted mailbox which didn't had any retention policy applied?
Additionally observed that PowerShell 'Get-Mailbox' property RecipientSoftDeletedStatus has value '1' for mailbox where IsInactivemailbox is False and '9' where IsInactivemailbox is True. What does RecipientSoftDeletedStatus values indicate?
- There are some indirect mentions here: https://learn.microsoft.com/en-us/purview/ediscovery-content-search-reference#searching-disconnected-or-de-licensed-mailboxes
8 Replies
- I'm not sure whether you can access those via EWS. Via PowerShell, you can do:
Get-Mailbox -SoftDeletedMailbox -Filter {IsInactiveMailbox -eq $false}- ShreyasGuptaCopper ContributorYes, I fetch soft deleted mailbox using the same PowerShell command. But after that I use Exchange Web Services(EWS) Managed API to fetch root folder using ExchangeService object with autodiscovery url and mailbox impersonation.
I'm able to retrieve data with above mechanism for soft deleted mailboxes marked as Inactive. But same doesn't work for soft deleted but NOT inactive mailboxes.- I believe such mailboxes are not available via any client/API method, even eDiscovery.