SOLVED

Recreate a mailbox for an existing user?

%3CLINGO-SUB%20id%3D%22lingo-sub-1413009%22%20slang%3D%22en-US%22%3ERecreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1413009%22%20slang%3D%22en-US%22%3E%3CP%3EHere's%20what%20I'd%20like%20to%20do%3A%3C%2FP%3E%3CUL%3E%3CLI%3EA%20mail%20user%20is%20created%20an%20assigned%20a%20license%20at%20some%20point.%20The%20user%20may%20have%20been%20synchronized%20from%20on-prem%20or%20may%20have%20been%20created%20directly%20in%20Azure%20AD.%3C%2FLI%3E%3CLI%3EAt%20a%20later%20point%2C%20I%20want%20to%20recreate%20the%20user's%20mailbox%20without%20deleting%20the%20user%20so%20the%20user%20can%20start%20with%20a%20fresh%20mailbox.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EHere's%20what%20I've%20tried%3A%3C%2FP%3E%3CUL%3E%3CLI%3ERemove%20the%20user's%20license%2C%20verify%20the%20mailbox%20cannot%20be%20located%20by%20Get-Mailbox%2C%20add%20back%20the%20license.%20Result%3A%20the%20user%20is%20reattached%20to%20the%20same%20mailbox.%20Obviously%20this%20sequence%20happens%20within%20the%2030-day%20retention%20period.%3C%2FLI%3E%3CLI%3EConvert%20the%20mailbox%20to%20shared%2C%20remove%20the%20user's%20license%2C%20add%20back%20the%20license.%20Result%3A%20the%20user%20is%20reattached%20to%20the%20same%20mailbox%2C%20though%20it%20is%20still%20shared.%3C%2FLI%3E%3CLI%3EAttempt%20to%20use%20Disable-Mailbox%20-PermanentlyDisable.%20Result%3A%20failure%20because%20the%20user%20is%20licensed.%3C%2FLI%3E%3CLI%3ERemove%20the%20user's%20license%20and%20then%20attempt%20to%20run%20Disable-Mailbox%20-PermanentlyDisable.%20Result%3A%20failure%20because%20the%20mailbox%20cannot%20be%20found.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EI'm%20starting%20to%20think%20what%20I%20want%20to%20do%20is%20simply%20not%20possible%2C%20but%20I%20thought%20I'd%20fish%20for%20some%20fresh%20ideas%20since%20I'm%20out%20of%20them.%20One%20thought%20I%20had%20was%20to%20purge%20the%20deleted%20mailbox%20before%20the%2030-day%20retention%20period%20is%20up%2C%20but%20I%20don't%20see%20a%20way%20to%20get%20a%20handle%20to%20it.%20Attempt%20to%20use%20Get-Mailbox%20with%20-IncludeInactiveMailbox%20and%20-SoftDeletedMailbox%20haven't%20located%20the%20mailbox%20for%20me.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1413009%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1413441%22%20slang%3D%22en-US%22%3ERe%3A%20Recreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1413441%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F544770%22%20target%3D%22_blank%22%3E%40chad512%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%20you%20should%20be%20able%20to%20achieve%20this%20by%20purging%20the%20Deleted%20Users%20folder%20as%20you%20have%20indicated.%20%26nbsp%3BTo%20do%20this%2C%20connect%20to%20Powershell%20as%20follows%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EConnect-MsolService%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EGet-MsolUser%20-MaxResults%2060%20-ReturnDeletedUsers%20%7C%20Remove-MsolUser%20-RemoveFromRecycleBin%20-Force%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20recreating%20and%20licensing%20the%20user%2C%20you%20will%20now%20have%20a%20nice%20blank%20mailbox.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1413704%22%20slang%3D%22en-US%22%3ERe%3A%20Recreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1413704%22%20slang%3D%22en-US%22%3EMy%20goal%20is%20to%20not%20recreate%20the%20user%2C%20though.%20I%20want%20the%20user%20object%20left%20as%20it%20is%2C%20but%20I%20want%20to%20recreate%20that%20user's%20mailbox.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1413748%22%20slang%3D%22en-US%22%3ERe%3A%20Recreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1413748%22%20slang%3D%22en-US%22%3EAh%20I%20get%20it.%20Only%20way%20I%20can%20see%20this%20working%20is%20if%20the%20user%20was%20synced%20from%20AD.%20Process%20would%20be%3A%3CBR%20%2F%3E%3CBR%20%2F%3E1).%20Move%20the%20user%20in%20AD%20to%20an%20OU%20which%20is%20not%20synced.%3CBR%20%2F%3E2).%20Wait%20for%2For%20force%20ad%20sync.%20The%20O365%20user%20will%20be%20moved%20to%20deleted%20users%20folder.%3CBR%20%2F%3E3).%20Run%20the%20PowerShell%20to%20purge%20Deleted%20users%3CBR%20%2F%3E4).%20Move%20the%20AD%20user%20back%20to%20synced%20OU%2C%20run%20sync%2C%20and%20the%20user%20is%20recreated%20for%20you.%3CBR%20%2F%3E5).%20Assign%20licence.%20Good%20to%20go.%3CBR%20%2F%3E%3CBR%20%2F%3EMaybe%20still%20not%20exactly%20what%20you%20want%2C%20but%20I%20think%20it%20is%20as%20good%20as%20you%20are%20going%20to%20get.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1413957%22%20slang%3D%22en-US%22%3ERe%3A%20Recreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1413957%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F616707%22%20target%3D%22_blank%22%3E%40PeterRising%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20afraid%20you%20may%20be%20right.%20That%20leaves%20me%20with%20a%20user%20whose%20other%20cloud%20content%20is%20removed%2C%20which%20is%20bad%20in%20my%20case.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1413962%22%20slang%3D%22en-US%22%3ERe%3A%20Recreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1413962%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F544770%22%20target%3D%22_blank%22%3E%40chad512%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAm%20curious%20to%20know%20the%20reason%20why%20a%20fresh%20mailbox%20is%20desirable%3F%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fsmile_40x40.gif%22%20alt%3D%22%3Asmile%3A%22%20title%3D%22%3Asmile%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1413973%22%20slang%3D%22en-US%22%3ERe%3A%20Recreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1413973%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F616707%22%20target%3D%22_blank%22%3E%40PeterRising%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20often%20the%20case%20in%20migration%20scenarios%20that%20users%20are%20provisioned%20in%20the%20service%20before%20their%20mail%20is%20migrated%2C%20so%20they%20start%20using%20things%20like%20OneDrive%20and%20SharePoint%20long%20before%20the%20mail%20switch.%20Migration%20testing%20may%20push%20data%20into%20the%20service%20mailbox%20that%20we%20want%20to%20purge%20before%20the%20actual%20migration.%20Recreating%20the%20user%20would%20mean%20the%20user%20loses%20all%20of%20their%20accumulated%20non-mail%20data.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1414005%22%20slang%3D%22en-US%22%3ERe%3A%20Recreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1414005%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F544770%22%20target%3D%22_blank%22%3E%40chad512%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOK%2C%20maybe%20a%20little%20fiddly%20and%20messy%2C%20but%20how%20about%20enabling%20the%20Online%20Archive%20for%20the%20mailboxes%20in%20this%20situation%20and%20then%20create%20a%20new%20Exchange%20Retention%20Policy%20In%20the%20Exchange%20Admin%20Center%20to%20move%20content%20to%20the%20archive%20which%20is%20older%20than%2014%20days%20(along%20the%20lines%20of%20the%20below).%20%26nbsp%3BAssign%20this%20new%20retention%20policy%20only%20to%20the%20users%20who's%20mailboxes%20you%20want%20to%20clear%20out.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202020-05-23%20at%2020.12.44.png%22%20style%3D%22width%3A%20858px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F194094i5B8273BCE0A3B2DB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Screenshot%202020-05-23%20at%2020.12.44.png%22%20alt%3D%22Screenshot%202020-05-23%20at%2020.12.44.png%22%20%2F%3E%3C%2FSPAN%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20the%20move%20to%20archive%20has%20completed%2C%20disable%20the%20Online%20Archive%20for%20that%20user%20(making%20sure%20that%20you%20don't%20re-enable%20it%20for%20at%20least%2030%20days%20or%20the%20content%20will%20return).%20%26nbsp%3BThen%2C%20make%20sure%20you%20assign%20the%20default%20retention%20policy%20back%20to%20that%20user.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou'd%20have%20to%20be%20very%20diligent%20about%20assigning%20this%20temporary%20policy.%20%26nbsp%3BIt%20could%20just%20as%20easily%20get%20you%20into%20trouble%20if%20assigned%20incorrectly.%20%26nbsp%3B%20If%20you%20plan%20to%20give%20it%20a%20try%2C%20test%20it%20to%20the%20hilt%20first%20I%20would%20say.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1414762%22%20slang%3D%22en-US%22%3ERe%3A%20Recreate%20a%20mailbox%20for%20an%20existing%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1414762%22%20slang%3D%22en-US%22%3EI'll%20give%20it%20a%20shot.%20Thanks!%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Here's what I'd like to do:

  • A mail user is created an assigned a license at some point. The user may have been synchronized from on-prem or may have been created directly in Azure AD.
  • At a later point, I want to recreate the user's mailbox without deleting the user so the user can start with a fresh mailbox.

Here's what I've tried:

  • Remove the user's license, verify the mailbox cannot be located by Get-Mailbox, add back the license. Result: the user is reattached to the same mailbox. Obviously this sequence happens within the 30-day retention period.
  • Convert the mailbox to shared, remove the user's license, add back the license. Result: the user is reattached to the same mailbox, though it is still shared.
  • Attempt to use Disable-Mailbox -PermanentlyDisable. Result: failure because the user is licensed.
  • Remove the user's license and then attempt to run Disable-Mailbox -PermanentlyDisable. Result: failure because the mailbox cannot be found.

I'm starting to think what I want to do is simply not possible, but I thought I'd fish for some fresh ideas since I'm out of them. One thought I had was to purge the deleted mailbox before the 30-day retention period is up, but I don't see a way to get a handle to it. Attempt to use Get-Mailbox with -IncludeInactiveMailbox and -SoftDeletedMailbox haven't located the mailbox for me.

8 Replies
Highlighted

@chad512 

 

Hi, you should be able to achieve this by purging the Deleted Users folder as you have indicated.  To do this, connect to Powershell as follows;

 

Connect-MsolService

 

Get-MsolUser -MaxResults 60 -ReturnDeletedUsers | Remove-MsolUser -RemoveFromRecycleBin -Force

 

When recreating and licensing the user, you will now have a nice blank mailbox.

Highlighted
My goal is to not recreate the user, though. I want the user object left as it is, but I want to recreate that user's mailbox.
Highlighted
Ah I get it. Only way I can see this working is if the user was synced from AD. Process would be:

1). Move the user in AD to an OU which is not synced.
2). Wait for/or force ad sync. The O365 user will be moved to deleted users folder.
3). Run the PowerShell to purge Deleted users
4). Move the AD user back to synced OU, run sync, and the user is recreated for you.
5). Assign licence. Good to go.

Maybe still not exactly what you want, but I think it is as good as you are going to get.
Highlighted

@PeterRising 

 

I'm afraid you may be right. That leaves me with a user whose other cloud content is removed, which is bad in my case.

Highlighted

@chad512 

 

Am curious to know the reason why a fresh mailbox is desirable? :smile:

Highlighted

@PeterRising 

 

It's often the case in migration scenarios that users are provisioned in the service before their mail is migrated, so they start using things like OneDrive and SharePoint long before the mail switch. Migration testing may push data into the service mailbox that we want to purge before the actual migration. Recreating the user would mean the user loses all of their accumulated non-mail data.

Highlighted
Best Response confirmed by chad512 (Occasional Contributor)
Solution

@chad512 

 

OK, maybe a little fiddly and messy, but how about enabling the Online Archive for the mailboxes in this situation and then create a new Exchange Retention Policy In the Exchange Admin Center to move content to the archive which is older than 14 days (along the lines of the below).  Assign this new retention policy only to the users who's mailboxes you want to clear out.

 

Screenshot 2020-05-23 at 20.12.44.png 

Once the move to archive has completed, disable the Online Archive for that user (making sure that you don't re-enable it for at least 30 days or the content will return).  Then, make sure you assign the default retention policy back to that user.

 

You'd have to be very diligent about assigning this temporary policy.  It could just as easily get you into trouble if assigned incorrectly.   If you plan to give it a try, test it to the hilt first I would say.

 

Highlighted
I'll give it a shot. Thanks!