Exchange 2016: Remove / delete database

Deleting an Exchange database requires more than just moving the user mailboxes to a new database. Exchange databases also contain system mailboxes that are not displayed in the EAC.

When trying to delete or remove an Exchange database, the following error message appears:

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 . 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 -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database -Arbitration. To get a list of all Audit mailboxes in this database, run the command Get-Mailbox -Database -AuditLog.

Error when removing a database

As already mentioned at the beginning, these are system mailboxes. The mailboxes are visible via the Exchange Management Shell and must also be moved to another database:

image

The monitoring mailboxes (HealthMailbox) can be moved to another database with the following command:

Get-Mailbox -Database FWDB1 -monitoring | New-MoveRequest -TargetDatabase FWDB

image

After all monitoring mailboxes have been moved, you can check whether there are any other system mailboxes in the database to be removed:

get-mailbox -Database fwdb1 -Monitoring
get-mailbox -Database fwdb1 -AuditLog
get-mailbox -Database fwdb1 -Archive
get-mailbox -Database fwdb1 -RemoteArchive
get-mailbox -Database fwdb1 -PublicFolder
get-mailbox -Database fwdb1 -Arbitration
get-mailbox -Database fwdb1 -AuxAuditLog
get-mailbox -Database fwdb1 -GroupMailbox

If there are other mailboxes, these can also be moved with a MoveRequest. The status of the MoveRequest can be checked with the following command:

Get-MoveRequest | Get-MoveRequestStatistics

image

As soon as all moverequests have the status "Completed", the moverequests can be removed with the following command:

Get-MoveRequest | Remove-MoveRequest

image

The database can now be removed:

Get-MailboxDatabase FWDB1 | Remove-MailboxDatabase

image

The database files are not deleted and must be deleted manually.

image

12 thoughts on “Exchange 2016: Datenbank entfernen / löschen”

  1. Hallo Frank,
    ich habe das Problem, dass ich auf einen Exchange 2019 eine leere Datenbak nicht löschen kann.
    Bei dem Versuch gibt es den Fehler, der oben in dem Artikel zu sehen ist.
    Die commands:
    get-mailbox -Database exdb -Monitoring
    get-mailbox -Database exdb -AuditLog
    get-mailbox -Database exdb -Archive

    zeigen, dass es keine Mailbox in dieser DB befindet. Es ist leer.
    Die DB ist umoutetd Exchane Information Store wurde mehrmals restarted und der Server wurde auc rebootet.

    Hast du vielleicht eine Idee, woran es löiegen könne?

    Reply
  2. Bei mir war der Grund der Wert ArchiveDatabase einer Mailbox, obwohl das Archiv mit
    Get-Mailbox -Database DB01 -Archive nicht gefunden wurde.

    get-mailbox | ? {$_.archivedatabase -eq „DB01“}

    Reply
  3. Hallo Frank,
    bei einem Kunden ist die EDB total kaputt. Eseutil /p etc bringt alles nichts mehr.
    Datensicherung gibt es leider auch keine.
    Ich sichere nun alle Mails aus Outlook in eine pst und lege eine neue Datenbank an und würde neue Postfächer für die User erstellen auf der neuen Datenbank (Mails dann per pst Import zurück)

    Könntest du mir bitte kurz sagen, welche Systemmailboxen etc ich noch anlegen muss, da Verschieben etc. aufgrund der toten alten DB nicht mehr geht.

    Vielen vielen Dank!
    Beste Grüße Bernd

    Reply
  4. Ganz wichtig wenn man keine Mailboxen mehr findet und mehrere Domänen mit Vertrauensstellungen hat:

    Set-AdServerSettings -ViewEntireForest $True

    Dann werden auch die nicht angezeigten Mailboxen gefunden!

    Reply
  5. Habe das gleiche Problem wie Oli mit dem Fehler bezüglich PublicFolderMailboxMigrationRequest.
    Und ich sehe weder eine Mailbox noch Folder Migration für die Public Folder
    Ich kann die Datenbank nicht löschen.
    Auch einen Server-Neustart hat nichts gebracht.

    Reply
  6. Hi Frank,

    erstmal dickes Lob für die ganze Arbeit die hier rein steckst! Sind immer super Anleitungen die im Normalfall genau so funktionieren wie du sie runter schreibst. Habe schon einige Migrationen anhand deiner Anleitungen gemacht und konnte mich bisher nie beklagen… Von daher mal DANKE!

    Zu meiner Frage:
    Bei uns kann ich die standardmäßig erstellte Datenbank vom Exchange 2016 nicht löschen da er folgendes bemängelt:
    „This mailbox database is associated with one or more active PublicFolderMailboxMigration requests.“
    Der Befehl „Get-PublicFolderMailboxMigrationRequest | ?{ $_.RequestQueue -eq „MeinMailboxID“ }“ gibt nichts zurück von daher siehts ja gut aus. Trotzdem bringt er immer wieder die Meldung.
    Hast du dahin gehend einen Tipp bzw. Lösungsansatz?

    Danke schon mal im Voraus!

    Reply
    • Hi Oli,

      wenn die Migration der Öffentlichen Ordner abgeschlossen ist, sollte der folgende Befehl weiter helfen:

      Get-PublicFolderMigrationRequest | Remove-PublicFolderMigrationRequest

      Gruß,
      Frank

      Reply
  7. Hallo Frank
    kann man die Healt Mailboxen einfach so löschen bei einem laufenenden Exchange ?
    Ich erhalte diese Warnung:
    The mailbox 9163bdf3-fea8-43f1-aab9-7997459ca46c on database 3503e6cd-a38b-42ae-a829-344627df67cc is approaching its storage limit. A notification has been sent to the user. This warning will not be sent again for at least twenty four hours.

    Das ist ein Health Postfach …

    Reply
  8. Müssen die Monitoring Mailboxen verschoben werden, wenn es sich um die letzte Datenbank auf einem Exchange Server handelt, der deinstalliert werden soll?

    Reply

Leave a Comment