23 August 2017

Exchange 2016: How to move system mailboxes

Exchange 2016 has 5 types of system mailboxes: Discovery Search (1 mbx), Arbitration (6 mbx), AuditLog (1 mbx), Public Folder (not created by default) and Monitoring (the number depends on the number of databases). All of them are necessary for full-fledged Exchange's work.

You can't delete the first mailbox database (or another one) until all system mailboxes migrate to a new database.


[PS] C:\Windows\system32>Remove-MailboxDatabase "Mailbox Database 1387724892"
This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes, Audit mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database <Database ID>. To get a list of all mailbox plans in this database, run the command Get-MailboxPlan. To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database <Database ID>
-PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -Arbitration. To get a list of all Audit mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -AuditLog. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID>. To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -Archive. To disable a public folder mailbox so that you can delete the
mailbox database, run the command Disable-Mailbox <Mailbox ID> -PublicFolder. To disable a Audit mailbox so that you can delete the mailbox database, run the command Get-Mailbox -AuditLog | Disable-Mailbox. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest <parameters>. If this is the last server in the organization, run the command Disable-Mailbox <Mailbox ID> -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox. Mailbox plans should be moved to another server; to do this, run the command Set-MailboxPlan <MailboxPlan ID> -Database <Database ID>.
    + CategoryInfo          : InvalidOperation: (Mailbox Database 1387724892:DatabaseIdParameter) [Remove-MailboxDatab
   ase], AssociatedUserMailboxExistException
    + FullyQualifiedErrorId : [Server=EXCHANGE,RequestId=fb582ab5-a5b9-4eb7-9b7e-837d15a9a9c6,TimeStamp=8/23/2017 6:15
   :08 PM] [FailureCategory=Cmdlet-AssociatedUserMailboxExistException] 4690FD5A,Microsoft.Exchange.Management.System
  ConfigurationTasks.RemoveMailboxDatabase
    + PSComputerName        : exchange.test.local

Arbitration mailboxes

Their account are located in the OU "<domain>/Users".

[PS] C:\Windows\system32>Get-Mailbox -Database "Mailbox Database 1387724892" -Arbitration | ft name, DisplayName
Name                                                        DisplayName
----                                                        -----------
SystemMailbox{1f05a927-5901-4b8a-b7c3-d04b8d3c4022}         Microsoft Exchange Approval Assistant
SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c}         Microsoft Exchange
SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}         Microsoft Exchange
Migration.8f3e7716-2011-43e4-96b1-aba62d229136              Microsoft Exchange Migration
FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042         Microsoft Exchange Federation Mailbox
SystemMailbox{D0E409A0-AF9B-4720-92FE-AAC869B0D201}         Microsoft Exchange

Moving Arbitration mailboxes to the new database: Get-Mailbox -Database "Mailbox Database 1387724892" -Arbitration | New-MoveRequest -TargetDatabase DB01

[PS] C:\Windows\system32>Get-Mailbox -Database "Mailbox Database 1387724892" -Arbitration | New-MoveRequest -TargetDatabase DB01
DisplayName               StatusDetail              TotalMailboxSize          TotalArchiveSize         PercentComplete
-----------               ------------              ----------------          ----------------         ---------------
Microsoft Exchange App... WaitingForJobPickup       0 B (0 bytes)                                      0
Microsoft Exchange        WaitingForJobPickup       27.73 KB (28,393 bytes)                            0
Microsoft Exchange        WaitingForJobPickup       34.22 KB (35,038 bytes)                            0
Microsoft Exchange Mig... WaitingForJobPickup       13.01 KB (13,324 bytes)                            0
Microsoft Exchange Fed... WaitingForJobPickup       0 B (0 bytes)                                      0
Microsoft Exchange        WaitingForJobPickup       0 B (0 bytes)                                      0

AuditLog mailbox

[PS] C:\Windows\system32>Get-Mailbox -Database "Mailbox Database 1387724892" -AuditLog | ft name, DisplayName
Name                                                        DisplayName----                                                        -----------SystemMailbox{8cc370d3-822a-4ab8-a926-bb94bd0641a9}         SystemMailbox{8cc370d3-822a-4ab8-a926-bb94bd0641a9}
Just move it: Get-Mailbox -Database "Mailbox Database 1387724892" -AuditLog | New-MoveRequest -TargetDatabase DB01

Public Folder mailbox

[PS] C:\Windows\system32>Get-Mailbox -PublicFolder
Name                      Alias                ServerName       ProhibitSendQuota
----                      -----                ----------       -----------------
PF01                      PF01                 exchange         Unlimited
Just move it: Get-Mailbox -Database "Mailbox Database 1387724892" -PublicFolder | New-MoveRequest -TargetDatabase DB01

Discovery Search Mailbox

Just move it: Get-Mailbox "DiscoverySearchMailbox {D919BA05-46A6-415f-80AD-7E09334BB852}" | New-MoveRequest -TargetDatabase DB01

Monitoring mailboxes

It is not necessary to remove Monitoring mailboxes (Health Mailbox) to delete the database:
[PS] C:\Windows\system32>Get-Mailbox -Monitoring
Name                      Alias                ServerName       ProhibitSendQuota
----                      -----                ----------       -----------------
HealthMailboxd03ced4d2... HealthMailboxd03c... exchange         Unlimited
HealthMailbox8c9bede14... HealthMailbox8c9b... exchange         Unlimited
HealthMailboxa4f2907d0... HealthMailboxa4f2... exchange         Unlimited
HealthMailbox6a914468b... HealthMailbox6a91... exchange         Unlimited
HealthMailboxb4bb92252... HealthMailboxb4bb... exchange         Unlimited
HealthMailbox31e52ad42... HealthMailbox31e5... exchange         Unlimited
HealthMailboxb1bfe64ab... HealthMailboxb1bf... exchange         Unlimited
HealthMailbox4313babb3... HealthMailbox4313... exchange         Unlimited
HealthMailbox9bfb060aa... HealthMailbox9bfb... exchange         Unlimited
HealthMailbox6d639dd81... HealthMailbox6d63... exchange         Unlimited
HealthMailbox74d627a29... HealthMailbox74d6... exchange         Unlimited
HealthMailbox37da615cf... HealthMailbox37da... exchange         Unlimited

[PS] C:\Windows\system32>Remove-MailboxDatabase "Mailbox Database 1387724892"
Confirm
Are you sure you want to perform this action?
Removing mailbox database "Mailbox Database 1387724892".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): Y
WARNING: The specified database has been removed. You must remove the database file located in C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 1387724892\Mailbox Database 1387724892.edb from your computer manually if it exists. Specified database: Mailbox Database 1387724892

But after that you will have several orphaned monitoring mailboxes:

[PS] C:\Windows\system32>Get-Mailbox -Monitoring | ft name
Name
----
HealthMailboxd03ced4d23864d06943d82153197a103
WARNING: The object test.local/Microsoft Exchange System Objects/Monitoring
Mailboxes/HealthMailboxd03ced4d23864d06943d82153197a103 has been corrupted or isn't compatible with Microsoft support
requirements, and it's in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.
HealthMailbox8c9bede148084c83a8b761f5f55e3388
HealthMailboxa4f2907d0e4a4d65b2720bbf8f2dbb4c
HealthMailbox6a914468b121464e99502b525d7bbb7a
WARNING: The object test.local/Microsoft Exchange System Objects/Monitoring
Mailboxes/HealthMailbox6a914468b121464e99502b525d7bbb7a has been corrupted or isn't compatible with Microsoft support
requirements, and it's in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.
HealthMailboxb4bb922528504ec590a3ef4da7dbc8d1
HealthMailbox31e52ad42db145baa2b7de99a462b9f4
WARNING: The object test.local/Microsoft Exchange System Objects/Monitoring
Mailboxes/HealthMailbox31e52ad42db145baa2b7de99a462b9f4 has been corrupted or isn't compatible with Microsoft support
requirements, and it's in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.
HealthMailboxb1bfe64abf994b088b40c61bc9de1d20
HealthMailbox4313babb3d5e4d9dbf7cf73ad844a5e4
WARNING: The object test.local/Microsoft Exchange System Objects/Monitoring
Mailboxes/HealthMailbox4313babb3d5e4d9dbf7cf73ad844a5e4 has been corrupted or isn't compatible with Microsoft support
requirements, and it's in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.
HealthMailbox9bfb060aaea044b09917f202365fda6b
HealthMailbox6d639dd81fbe4ec9960df34065d5f9fd
WARNING: The object test.local/Microsoft Exchange System Objects/Monitoring
Mailboxes/HealthMailbox6d639dd81fbe4ec9960df34065d5f9fd has been corrupted or isn't compatible with Microsoft support
requirements, and it's in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.
HealthMailbox74d627a29ff64f14b57a76a430a5738c
HealthMailbox37da615cf38042a88bc3cab20fb8e8d2
WARNING: The object test.local/Microsoft Exchange System Objects/Monitoring
Mailboxes/HealthMailbox37da615cf38042a88bc3cab20fb8e8d2 has been corrupted or isn't compatible with Microsoft support
requirements, and it's in an inconsistent state. The following validation errors happened:
WARNING: Database is mandatory on UserMailbox.
WARNING: Database is mandatory on UserMailbox.

Now you can easy recreate all monitoring/health mailboxes.

  1. Stop the "Microsoft Exchange Health Manager" (MSExchangeHM) service.
  2. Disable all monitoring mailboxes: Get-Mailbox -Monitoring | Disable-Mailbox

  3. [PS] C:\Windows\system32>Get-Mailbox -Monitoring | Disable-Mailbox
    Confirm
    Are you sure you want to perform this action?
    Disabling mailbox "test.local/Microsoft Exchange System Objects/Monitoring
    Mailboxes/HealthMailbox992574ed16184fb0820142a7b14f6917" will remove the Exchange properties from the Active Directory
    user object and mark the mailbox in the database for removal. If the mailbox has an archive or remote archive, the
    archive will also be marked for removal. In the case of remote archives, this action is permanent. You can't reconnect
    this user to the remote archive again.
    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): A

  4. Delete all accounts in "<domain>/Microsoft Exchange System Objects/Monitoring Mailboxes"
  5. Start the "Microsoft Exchange Health Manager" (MSExchangeHM) service.
After several minutes Exchange will create new monitoring mailboxes.

2 comments:

  1. SUPER helpful!!!
    Thank you for putting this together- saved me tons of times.

    ReplyDelete
  2. Very Helpful, although still having some minor issues with Exchange still needing the old mailbox, this was very helpful in finding out all mailboxes on the old DB and being able to align things.. Thanks a million! Great Work!

    ReplyDelete