locked
Unable to remove Mailbox that has no associated AD account RRS feed

  • Question

  • Exchange 2013 SP1.  

    Ran into this issue with my Exchange 2013 test environment.  Basically I have an "orphaned" mailbox that I am unable to delete because there is no AD object for the mailbox.  This is probably easy i just cant figure out how to remove it.  When I try "remove-storemailbox" it thows back the "operation couldnt be performed because the object "username" couldnt be found. 

    Any ideas how I can remove this orphaned box?

    thanks

    *****************************************

    Info on how I got here in case this is not an easy fix:

    Deleted a particular user mailbox from EAC to free some room up.  I then wanted to purge the mailbox from the back end as it was still in database do to mailbox retention.

    I then did the following to make sure it was disconnected and to get the GUID for removal:

    Get-MailboxDatabase | Ge-MailboxStatistics | where { $_.Displayname "the user" } | fl DisplayName,Database,DisconnectReason,MailboxGuid

    To my suprise It listed the mailbox as being in two databases.  The mailbox GUID was the same for both.  One of the databases (the users active database at time of deletion) was listed with disconnect reason as disabled as expected.  The other database has the disconnectedreason property as blank.

    My guess is that this "dual database" happened during mailbox migration from Exchange 2007.  For this user, I do believe the migration failed initially to the first database (the one that is showing with no disconnectedreason) and I then had to fix the issue and restart the migration and it finished successfully to the second database.

    I wrote this off and proceeded to purge the mailbox using the "remove-StoreMailbox -Identity "username" -MailboxState Disabled" command.

    This removed the disconnected mailbox, however the other orphaned mailbox is still there!  Now I cant figure out how to remove this orphaned mailbox, because there is no longer an AD account associated with the mailbox and I run into the object couldnt be found error.

    How can I get this mailbox removed?

    Thursday, February 5, 2015 6:14 PM

Answers

  • To sum up what was done to remove orphaned box:

    1. Display the orphaned mailbox and get the GUID

    Get-MailboxDatabase | Get-MailboxStatistics | where { $_.Displayname "the user" } | fl DisplayName,MailboxGuid

    2. Create a new temporary AD account

    3. Run the following command to connect the orphaned box to the new temporary AD account:

    Connect-Mailbox -Identity "Display name of orphaned mailbox" -Database DbOfOrphanedBox -User "usernameoftempuser"
    
    

    4. Run the following to remove the orphaned mailbox and temp AD account:

    Remove-Mailbox -Identity <GUID> -Permanent $true

    5. Verify that the orphaned box is gone:

    Get-MailboxDatabase | Ge-MailboxStatistics | where { $_.Displayname "Display Name of orphaned box" }
    Nothing should be returned


    • Marked as answer by mac1234 Friday, February 6, 2015 4:41 PM
    • Edited by mac1234 Friday, February 6, 2015 4:42 PM
    Friday, February 6, 2015 4:41 PM

All replies

  • Hi,

    From your description, you can associate this problematic mailbox with an AD account at first. And then remove this mailbox using the Remove-Mailbox -Identity "xxx" cmdlet to check the result.

    Hope this can be helpful to you.

    Best regards,

    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    Amy Wang
    TechNet Community Support

    • Proposed as answer by Amy.Wang Monday, February 9, 2015 1:15 AM
    Friday, February 6, 2015 8:23 AM
  • I first create a new temp account in AD called "tempuser".

    Then from the exchange shell I run:

    Connect-Mailbox -Identity "Display name of orphaned mailbox" -Database DBXXX -User "tempuser"

    This successfully connects the orphaned mailbox to the new user.

    The user "tempuser" shows in the EAC and I can check properties and see that the mailbox is indeed connected as it is 1.5GB in size.

    I then try to delete from EAC as you would normally.  The account is removed from EAC and the AD object is deleted.  However when I check the disconnect reason for the mailbox it still shows as blank and I am still unable to remove the mailbox.

    Trying to remove from the exchange shell using:

    Remove-Mailbox -Identity <GUID>

    Also removes the account from EAC and AD, but as before, the Mailboxstistics command still does not show a disconnect reason which means I still cannot permanently delete.

    I have to be missing a simple command here.

    Friday, February 6, 2015 4:29 PM
  • Just after I poste the above, I tried the following:

    Remove-Mailbox -Identity <GUID> -Permanent $true

    Again as before, the command was successful but this time with including "-Permanent $true" it did in fact delete the mailbox!

    Performing:

    Get-MailboxDatabase | Ge-MailboxStatistics | where { $_.Displayname "the user" }
    No longer returns the orphaned mailbox.  It is gone, thanks.

    Friday, February 6, 2015 4:33 PM
  • To sum up what was done to remove orphaned box:

    1. Display the orphaned mailbox and get the GUID

    Get-MailboxDatabase | Get-MailboxStatistics | where { $_.Displayname "the user" } | fl DisplayName,MailboxGuid

    2. Create a new temporary AD account

    3. Run the following command to connect the orphaned box to the new temporary AD account:

    Connect-Mailbox -Identity "Display name of orphaned mailbox" -Database DbOfOrphanedBox -User "usernameoftempuser"
    
    

    4. Run the following to remove the orphaned mailbox and temp AD account:

    Remove-Mailbox -Identity <GUID> -Permanent $true

    5. Verify that the orphaned box is gone:

    Get-MailboxDatabase | Ge-MailboxStatistics | where { $_.Displayname "Display Name of orphaned box" }
    Nothing should be returned


    • Marked as answer by mac1234 Friday, February 6, 2015 4:41 PM
    • Edited by mac1234 Friday, February 6, 2015 4:42 PM
    Friday, February 6, 2015 4:41 PM