Thursday, February 16, 2012

Exchange 2010 move System Mailboxes to new database and remove the default mailbox database



After you’ve installed a new Exchange 2010 environment and you try to delete the first automatically created mailbox database, you’ll receive an error message, saying it still contains mailboxes.
You cannot remove the database, because there are still some hidden, system mailboxes in it, although it looks empty.
You will need to move these system mailboxes to a new database before this default database can be deleted.


Here are the steps to follow:

Open Exchange Management Shell with Administrator rights, then:

1. List the arbitration (system) mailboxes in the database you want to remove (the wrap parameter must be also specified, otherwise the full GUID name won't be displayed!):

Get-Mailbox -Database "<DEFAULT_DATABASE_NAME>" -Arbitration | ft -wrap -auto


Example:

Get-Mailbox -Database "Mailbox Database 0019304662" -Arbitration | ft -wrap -auto

Output sample (sorry it looks disorted in the blog):

Name                                                Alias                                               ServerName Proh
                                                                                                                   ibit
                                                                                                                   Send
                                                                                                                   Quot
                                                                                                                   a
----                                                -----                                               ---------- ----
SystemMailbox{1f05a927-6cae-4b43-9e78-20b3905e51b9} SystemMailbox{1f05a927-6cae-4b43-9e78-20b3905e51b9} mars       unli
                                                                                                                   mite
                                                                                                                   d
SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9} SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9} mars       unli
                                                                                                                   mite
                                                                                                                   d
FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 mars       1 MB
                                                                                                                    (1,
                                                                                                                   048,
                                                                                                                   576
                                                                                                                   byte
                                                                                                                   s)

-> This means there are still 3 system mailboxes inside the first mailbox database (created by Exchange setup, called 'Mailbox Database 0019304662'), that we want to remove on the server named MARS


2. Move each system mailboxes to the new database, copy and paste their identity name from the previous command:

New-MoveRequest -Identity "<SYSTEM_MAILBOX_NAME>" -TargetDatabase "<TARGET_DATABASE_NAME>"


Example:

New-MoveRequest -Identity "SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}" -TargetDatabase "Employee Mailbox Store"

Output sample (sorry it looks disorted in the blog):

DisplayName               Status                    TotalMailboxSize          TotalArchiveSize         PercentComplete
-----------               ------                    ----------------          ----------------         ---------------
Microsoft Exchange        Queued                    80.16 KB (82,081 bytes)                            0


-> In this example, our target mailbox database is called 'Employee Mailbox Store'


3. Don't remove the default (in our case 'Mailbox Database 0019304662') mailbox database yet, first remove the move requests for these mailboxes from the Management Console.
If you forget this step, you will have to manually remove these corrupted move requests from the Management Shell, otherwise no move requests can be displayed in the Management Console.

Use this command to remove requests from the Management Console:

Remove-MoveRequest -Identity "<SYSTEM_MAILBOX_NAME>"


Example:

Remove-MoveRequest -Identity "SystemMailbox{1f05a927-6cae-4b43-9e78-20b3905e51b9}"

Output sample:

Confirm
Are you sure you want to perform this action?
Move request 'Microsoft Exchange Approval Assistant' is corrupted or not recognized: Source database for the move
doesn't match. Active Directory value: '(null)'. Move request value: 'Mailbox Database 0019304662'.. Are you sure you
want to remove it?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): y

-> Copy and paste the Identity name for the system mailboxes, repeat for each

After the move requests are removed, you can now delete the default mailbox database itself.
It will still leave the .EDB file in the Exchange directory, you will need to remove it manually.

No comments:

Post a Comment