How to work with Inactive Mailboxes

Published Jan 29 2019 05:00 AM 24.3K Views

It usually starts with the following question: Is there a way to release the license of an Exchange Online user that left the company, but at the same time, keep the mailbox content? To get this done, we have a feature called Inactive mailboxes, but as we have seen some of our customers being a bit confused about the sequence of steps that needs to be taken to do this correctly, I wanted to cover this scenario.

Scenario

David is a cloud-only user. David currently has an Office 365 Enterprise E5 license. David leaves the company, so as an Admin, I’ll need to remove his account, but I still need to have access to his emails.

Note: In this article, we will provide the steps that have to be taken in order to correctly move a mailbox from the Active state to the Inactive state. Details about how to access the content of an inactive mailbox can be found here.

Before you begin

You have to be connected with PowerShell to Azure Active Directory / Microsoft Online Directory Service (MSODS) and to Exchange Online in order to complete tasks mentioned on this article.

Steps to take

1. Put the mailbox on a hold (which will also place the Archive on the hold, if it is present). For this scenario I’ve used LitigationHold, but, any hold from Exchange Online, or Security and Compliance can be used:

Set-Mailbox David -LitigationHoldEnabled $True -LitigationHoldDuration Unlimited

Note: The hold setting may take up to 60 minutes to take effect.

2. Ensure the mailbox has Litigation Hold enabled:

Get-Mailbox David | fl PrimarySMTPAddress, Identity, LitigationHoldEnabled, LitigationHoldDuration, MailboxPlan, PersistedCapabilities, SKUAssigned

User properties should now show:

PrimarySmtpAddress : David@contoso.com
Identity : David
LitigationHoldEnabled : True
LitigationHoldDuration : Unlimited
MailboxPlan : ExchangeOnlineEnterprise-0527a260-bea3-46a3-9f4f-215fdd24f4d9
PersistedCapabilities : {BPOS_S_O365PAM, BPOS_S_ThreatIntelligenceAddOn, BPOS_S_EquivioAnalytics, BPOS_S_CustomerLockbox, BPOS_S_Analytics, BPOS_S_Enterprise}
SKUAssigned : True

3. Check the number of licenses you have in total/assigned:

Get-MsolAccountSku | fl AccountSkuId, ActiveUnits, ConsumedUnits

Example of what you might get:

AccountSkuId : contoso:ENTERPRISEPREMIUM
ActiveUnits : 25
ConsumedUnits : 3

ConsumedUnits represents the number of licenses that are currently assigned.

4. Remove the Azure Active Directory user, which will move the mailbox to inactive state:

Remove-MsolUser -UserPrincipalName David@contoso.com

5. Check if the mailbox was deleted and become an inactive mailbox:

Get-Mailbox David -InactiveMailboxOnly | fl PrimarySMTPAddress, Identity, LitigationHoldEnabled, LitigationHoldDuration, SKUAssigned, IsInactiveMailbox, IsSoftDeletedByRemove, WhenSoftDeleted

The results should be similar to:

PrimarySmtpAddress : David@contoso.com
Identity : Soft Deleted Objects\David
LitigationHoldEnabled : True
LitigationHoldDuration : Unlimited
SKUAssigned : False
IsInactiveMailbox : True
IsSoftDeletedByRemove : True
WhenSoftDeleted : 6/4/2018 6:42:11 AM

6. Check if the Azure Active Directory user was deleted (you should be able to see it in the list of Deleted users, or you can run a command similar to the one below):

Get-MsolUser -ReturnDeletedUsers -All | where {$_.ProxyAddresses -match "David@contoso.com"} | fl UserPrincipalName, IsLicensed, Licenses

The results should be similar to:

UserPrincipalName : David@contoso.com
IsLicensed : True
Licenses : {contoso:ENTERPRISEPREMIUM}

7. Check the number of licenses you have in total/assigned (the license for the user that is now deleted should be released):

Get-MsolAccountSku | fl AccountSkuId, ActiveUnits, ConsumedUnits

The results should be similar to:

AccountSkuId : contoso:ENTERPRISEPREMIUM
ActiveUnits : 25
ConsumedUnits : 2

Optional (if you want to remove the Azure Active Directory user for good):

8. Wait for 30 days to have the Azure Active Directory user deleted from the Deleted Users list, or run a command similar to the below in order to permanently remove the user:

Get-MsolUser –ReturnDeletedUsers -All | where {$_.ProxyAddresses -match "David@contoso.com"} | Remove-MsolUser -RemoveFromRecycleBin

9. Check if the user still exists in the Active Users, or in Deleted Users (for both commands no results should be returned and you should not see the user within Deleted users anymore):

Get-MsolUser -All | where {$_.ProxyAddresses –match “David@contoso.com”}
Get-MsolUser -ReturnDeletedUsers -All | where {$_.ProxyAddresses -match "David@contoso.com"}

10. Verify that the mailbox is still in the inactive state, and the Litigation Hold is still enabled:

Get-Mailbox David -InactiveMailboxOnly | fl PrimarySMTPAddress, LitigationHoldEnabled, LitigationHoldDuration, SKUAssigned, IsInactiveMailbox

The result should be similar to:

PrimarySmtpAddress : David@contoso.com
LitigationHoldEnabled : True
LitigationHoldDuration : Unlimited
SKUAssigned : False
IsInactiveMailbox : True

References; additional information / more details on:

Thanks to Mark Johnson, Nino Bilic and Murali Natarajan for their support and contribution to this blog post!

Cristian Dimofte

21 Comments
%3CLINGO-SUB%20id%3D%22lingo-sub-608881%22%20slang%3D%22en-US%22%3EHow%20to%20work%20with%20Inactive%20Mailboxes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-608881%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20usually%20starts%20with%20the%20following%20question%3A%20%3CI%3EIs%20there%20a%20way%20to%20release%20the%20license%20of%20an%20Exchange%20Online%20user%20that%20left%20the%20company%2C%20but%20at%20the%20same%20time%2C%20keep%20the%20mailbox%20content%3F%3C%2FI%3E%20To%20get%20this%20done%2C%20we%20have%20a%20feature%20called%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Finactive-mailboxes-in-office-365%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EInactive%20mailboxes%3C%2FA%3E%2C%20but%20as%20we%20have%20seen%20some%20of%20our%20customers%20being%20a%20bit%20confused%20about%20the%20sequence%20of%20steps%20that%20needs%20to%20be%20taken%20to%20do%20this%20correctly%2C%20I%20wanted%20to%20cover%20this%20scenario.%3C%2FP%3E%3CH2%20id%3D%22toc-hId-1760055966%22%20id%3D%22toc-hId-1760056901%22%3EScenario%3C%2FH2%3E%3CB%3EDavid%3C%2FB%3E%20is%20a%20cloud-only%20user.%20David%20currently%20has%20an%20%3CI%3EOffice%20365%20Enterprise%20E5%20%3C%2FI%3Elicense.%20David%20leaves%20the%20company%2C%20so%20as%20an%20Admin%2C%20I%E2%80%99ll%20need%20to%20remove%20his%20account%2C%20but%20I%20still%20need%20to%20have%20access%20to%20his%20emails.%3CP%20class%3D%22note%22%3ENote%3A%20In%20this%20article%2C%20we%20will%20provide%20the%20steps%20that%20have%20to%20be%20taken%20in%20order%20to%20correctly%20move%20a%20mailbox%20from%20the%20Active%20state%20to%20the%20Inactive%20state.%20Details%20about%20how%20to%20access%20the%20content%20of%20an%20inactive%20mailbox%20can%20be%20found%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fcreate-and-manage-inactive-mailboxes%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehere.%3C%2FA%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--792100995%22%20id%3D%22toc-hId--792100060%22%3EBefore%20you%20begin%3C%2FH2%3EYou%20have%20to%20be%20connected%20with%20PowerShell%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fenterprise%2Fpowershell%2Fconnect-to-office-365-powershell%23connect-with-the-microsoft-azure-active-directory-module-for-windows-powershell%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EAzure%20Active%20Directory%20%2F%20Microsoft%20Online%20Directory%20Service%3C%2FA%3E%20(MSODS)%20and%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fexchange%2Fexchange-online%2Fconnect-to-exchange-online-powershell%2Fconnect-to-exchange-online-powershell%3Fview%3Dexchange-ps%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EExchange%20Online%3C%2FA%3E%20in%20order%20to%20complete%20tasks%20mentioned%20on%20this%20article.%3CH2%20id%3D%22toc-hId-950709340%22%20id%3D%22toc-hId-950710275%22%3ESteps%20to%20take%3C%2FH2%3E%3CB%3E1.%20Put%20the%20mailbox%20on%20a%20hold%20(which%20will%20also%20place%20the%20Archive%20on%20the%20hold%2C%20if%20it%20is%20present).%20For%20this%20scenario%20I%E2%80%99ve%20used%20LitigationHold%2C%20but%2C%20any%20hold%20from%20Exchange%20Online%2C%20or%20Security%20and%20Compliance%20can%20be%20used%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3ESet-Mailbox%20David%20-LitigationHoldEnabled%20%24True%20-LitigationHoldDuration%20Unlimited%3C%2FP%3E%0A%3CP%20class%3D%22note%22%3ENote%3A%20The%20hold%20setting%20may%20take%20up%20to%2060%20minutes%20to%20take%20effect.%3C%2FP%3E%3CB%3E2.%20Ensure%20the%20mailbox%20has%20Litigation%20Hold%20enabled%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3EGet-Mailbox%20David%20%7C%20fl%20PrimarySMTPAddress%2C%20Identity%2C%20LitigationHoldEnabled%2C%20LitigationHoldDuration%2C%20MailboxPlan%2C%20PersistedCapabilities%2C%20SKUAssigned%3C%2FP%3EUser%20properties%20should%20now%20show%3A%3CP%20class%3D%22code%22%3EPrimarySmtpAddress%20%3A%20David%40contoso.com%3CBR%20%2F%3EIdentity%20%3A%20David%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3ELitigationHoldEnabled%20%3A%20True%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3ELitigationHoldDuration%20%3A%20Unlimited%3C%2FSPAN%3E%3CBR%20%2F%3EMailboxPlan%20%3A%20ExchangeOnlineEnterprise-0527a260-bea3-46a3-9f4f-215fdd24f4d9%3CBR%20%2F%3EPersistedCapabilities%20%3A%20%7BBPOS_S_O365PAM%2C%20BPOS_S_ThreatIntelligenceAddOn%2C%20BPOS_S_EquivioAnalytics%2C%20BPOS_S_CustomerLockbox%2C%20BPOS_S_Analytics%2C%20BPOS_S_Enterprise%7D%3CBR%20%2F%3ESKUAssigned%20%3A%20True%3C%2FP%3E%3CB%3E3.%20Check%20the%20number%20of%20licenses%20you%20have%20in%20total%2Fassigned%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3EGet-MsolAccountSku%20%7C%20fl%20AccountSkuId%2C%20ActiveUnits%2C%20ConsumedUnits%3C%2FP%3EExample%20of%20what%20you%20might%20get%3A%3CP%20class%3D%22code%22%3EAccountSkuId%20%3A%20contoso%3AENTERPRISEPREMIUM%3CBR%20%2F%3EActiveUnits%20%3A%2025%3CBR%20%2F%3EConsumedUnits%20%3A%203%3C%2FP%3E%3CB%3EConsumedUnits%3C%2FB%3E%20represents%20the%20number%20of%20licenses%20that%20are%20currently%20assigned.%20%3CB%3E4.%20Remove%20the%20Azure%20Active%20Directory%20user%2C%20which%20will%20move%20the%20mailbox%20to%20inactive%20state%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3ERemove-MsolUser%20-UserPrincipalName%20David%40contoso.com%3C%2FP%3E%3CB%3E5.%20Check%20if%20the%20mailbox%20was%20deleted%20and%20become%20an%20inactive%20mailbox%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3EGet-Mailbox%20David%20-InactiveMailboxOnly%20%7C%20fl%20PrimarySMTPAddress%2C%20Identity%2C%20LitigationHoldEnabled%2C%20LitigationHoldDuration%2C%20SKUAssigned%2C%20IsInactiveMailbox%2C%20IsSoftDeletedByRemove%2C%20WhenSoftDeleted%3C%2FP%3EThe%20results%20should%20be%20similar%20to%3A%3CP%20class%3D%22code%22%3EPrimarySmtpAddress%20%3A%20David%40contoso.com%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3EIdentity%20%3A%20Soft%20Deleted%20Objects%5CDavid%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3ELitigationHoldEnabled%20%3A%20True%3C%2FSPAN%3E%3CBR%20%2F%3ELitigationHoldDuration%20%3A%20Unlimited%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3ESKUAssigned%20%3A%20False%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3EIsInactiveMailbox%20%3A%20True%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3EIsSoftDeletedByRemove%20%3A%20True%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3EWhenSoftDeleted%20%3A%206%2F4%2F2018%206%3A42%3A11%20AM%3C%2FSPAN%3E%3C%2FP%3E%3CB%3E6.%20Check%20if%20the%20Azure%20Active%20Directory%20user%20was%20deleted%20(you%20should%20be%20able%20to%20see%20it%20in%20the%20list%20of%20Deleted%20users%2C%20or%20you%20can%20run%20a%20command%20similar%20to%20the%20one%20below)%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3EGet-MsolUser%20-ReturnDeletedUsers%20-All%20%7C%20where%20%7B%24_.ProxyAddresses%20-match%20%22David%40contoso.com%22%7D%20%7C%20fl%20UserPrincipalName%2C%20IsLicensed%2C%20Licenses%3C%2FP%3EThe%20results%20should%20be%20similar%20to%3A%3CP%20class%3D%22code%22%3EUserPrincipalName%20%3A%20David%40contoso.com%3CBR%20%2F%3EIsLicensed%20%3A%20True%3CBR%20%2F%3ELicenses%20%3A%20%7Bcontoso%3AENTERPRISEPREMIUM%7D%3C%2FP%3E%3CB%3E7.%20Check%20the%20number%20of%20licenses%20you%20have%20in%20total%2Fassigned%20(the%20license%20for%20the%20user%20that%20is%20now%20deleted%20should%20be%20released)%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3EGet-MsolAccountSku%20%7C%20fl%20AccountSkuId%2C%20ActiveUnits%2C%20ConsumedUnits%3C%2FP%3EThe%20results%20should%20be%20similar%20to%3A%3CP%20class%3D%22code%22%3EAccountSkuId%20%3A%20contoso%3AENTERPRISEPREMIUM%3CBR%20%2F%3EActiveUnits%20%3A%2025%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3EConsumedUnits%20%3A%202%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1797961126%22%20id%3D%22toc-hId--1797960191%22%3E%3CB%3EOptional%20(if%20you%20want%20to%20remove%20the%20Azure%20Active%20Directory%20user%20for%20good)%3A%3C%2FB%3E%3C%2FH3%3E%3CB%3E8.%20Wait%20for%2030%20days%20to%20have%20the%20Azure%20Active%20Directory%20user%20deleted%20from%20the%20Deleted%20Users%20list%2C%20or%20run%20a%20command%20similar%20to%20the%20below%20in%20order%20to%20permanently%20remove%20the%20user%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3EGet-MsolUser%20%E2%80%93ReturnDeletedUsers%20-All%20%7C%20where%20%7B%24_.ProxyAddresses%20-match%20%22David%40contoso.com%22%7D%20%7C%20Remove-MsolUser%20-RemoveFromRecycleBin%3C%2FP%3E%3CB%3E9.%20Check%20if%20the%20user%20still%20exists%20in%20the%20Active%20Users%2C%20or%20in%20Deleted%20Users%20(for%20both%20commands%20no%20results%20should%20be%20returned%20and%20you%20should%20not%20see%20the%20user%20within%20Deleted%20users%20anymore)%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3EGet-MsolUser%20-All%20%7C%20where%20%7B%24_.ProxyAddresses%20%E2%80%93match%20%E2%80%9CDavid%40contoso.com%E2%80%9D%7D%3CBR%20%2F%3EGet-MsolUser%20-ReturnDeletedUsers%20-All%20%7C%20where%20%7B%24_.ProxyAddresses%20-match%20%22David%40contoso.com%22%7D%3C%2FP%3E%3CB%3E10.%20Verify%20that%20the%20mailbox%20is%20still%20in%20the%20inactive%20state%2C%20and%20the%20Litigation%20Hold%20is%20still%20enabled%3A%3C%2FB%3E%3CP%20class%3D%22code%22%3EGet-Mailbox%20David%20-InactiveMailboxOnly%20%7C%20fl%20PrimarySMTPAddress%2C%20LitigationHoldEnabled%2C%20LitigationHoldDuration%2C%20SKUAssigned%2C%20IsInactiveMailbox%3C%2FP%3EThe%20result%20should%20be%20similar%20to%3A%3CP%20class%3D%22code%22%3EPrimarySmtpAddress%20%3A%20David%40contoso.com%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3ELitigationHoldEnabled%20%3A%20True%3C%2FSPAN%3E%3CBR%20%2F%3ELitigationHoldDuration%20%3A%20Unlimited%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3ESKUAssigned%20%3A%20False%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22color%3A%20%23ff0000%22%3EIsInactiveMailbox%20%3A%20True%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--55150791%22%20id%3D%22toc-hId--55149856%22%3EReferences%3B%20additional%20information%20%2F%20more%20details%20on%3A%3C%2FH3%3E%0A%3CUL%3E%0A%20%20%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fsecurity-and-compliance%2Fin-place-and-litigation-holds%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3ELitigation%2FIn-Place%20Holds%3C%2FA%3E%3C%2FLI%3E%0A%20%20%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fservicedescriptions%2Fexchange-online-archiving-service-description%2Fexchange-online-archiving-service-description%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EIn-Place%20Archive%3C%2FA%3E%3C%2FLI%3E%0A%20%20%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Finactive-mailboxes-in-office-365%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EInactive%20Mailboxes%3C%2FA%3E%3C%2FLI%3E%0A%20%20%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fcreate-and-manage-inactive-mailboxes%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EHow%20to%20create%20and%20manage%20Inactive%20Mailboxes%20in%20Office%20365%3C%2FA%3E%3C%2FLI%3E%0A%20%20%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fcreate-and-manage-inactive-mailboxes%23search-and-export-the-contents-of-an-inactive-mailbox%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EHow%20to%20search%20and%20export%20contents%20of%20an%20Inactive%20Mailbox%3C%2FA%3E%3C%2FLI%3E%0A%20%20%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fsecuritycompliance%2Fdelete-an-inactive-mailbox%22%20rel%3D%22noopener%20noreferrer%22%20target%3D%22_blank%22%3EHow%20to%20remove%20a%20hold%20from%20an%20Inactive%20Mailbox%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3EThanks%20to%20Mark%20Johnson%2C%20Nino%20Bilic%20and%20Murali%20Natarajan%20for%20their%20support%20and%20contribution%20to%20this%20blog%20post!%20%3CSPAN%20class%3D%22author%22%3ECristian%20Dimofte%3C%2FSPAN%3E%3C%2FLINGO-BODY%3E
Version history
Last update:
‎Jul 01 2019 04:35 PM
Updated by: