Exchange Server This mailbox database contains one or more mailboxes

Hello, Exchange Server When trying to delete a database on , you may encounter the following error:

Exchange Server on a reliable and trouble-free basis Databases To delete it, simply follow the steps below.

Exchange Server Error While Deleting Database

Exchange Server If there are objects such as mailbox, public folder etc. that are actively used in a database. Exchange Server We cannot delete the relevant database and it gives errors such as the following.

Error: 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>.
Set-MailboxPlan MailboxPlan ID -Database Database ID.
+ CategoryInfo : InvalidOperation: (Database ID :DatabaseIdParameter) [Remove-MailboxDatabase], AssociatedUserMailboxExistException
+ FullyQualifiedErrorId : [Server= Server,RequestId= RequestId,TimeStamp= TimeStamp ] [FailureCategory=Cmdlet-AssociatedUserMailboxExistException] XXXXXXXX,Microsoft.Exchange.Management.SystemConfigurationTasks.RemoveMailboxDatabase
+ PSComputerName : Computer Name

Exchange ServerIn order to resolve the error we receive when deleting a database, we need to list our active accounts in the database by following the steps below and then move them to other databases.

The Commands and Parameters we will use will be as follows;

  • Get-Mailbox -Database “Database-Name”
  • Get-Mailbox -Database “Database-Name” -Auditlog
  • Get-Mailbox -Database “Database-Name” -Monitoring
  • Get-Mailbox -Database “Database-Name” -Arbitration
  • Get-Mailbox -Database “Database-Name” -Archive
  • Get-Mailbox -Database “Database-Name” -PublicFolder

Mailbox Listing in Exchange Server

Exchange ServerBefore deleting the database in , first database actively involved in MailboxWe need to delete the 's or move them to another database. Exchange Management Shell To ensure controls regarding;

Get-Mailbox -Database “Database-Name”
Viewed accounts Exchange Management Shell or ECP using another Exchange Server you need to move it to the database.

Exchange Serviceon r Exchange Management Shell using Database to Database You can start the migration process.

New-MoveRequest (ExchangePowerShell) | Microsoft Learn

Get-Mailbox -Database DB01 | New-MoveRequest -TargetDatabase DB02 -BatchName "DB01toDB02"

The command I shared above, Exchange ServerIt is used to move mailboxes from one database to another.

  1. Get-Mailbox-Database DB01: This piece of command will fetch all the mailboxes in the database named “DB01”. Get-Mailbox The cmdlet lists the mailboxes in the specified database and provides a collection of objects to perform operations on those mailboxes.
  2. | (Pipe): In PowerShell, the pipe flag passes the output of one command as input to another command. In this case, Get-Mailbox The list of mailboxes produced by the command is followed by New-MoveRequest is transferred to the command.
  3. New-MoveRequest -TargetDatabase DB02 -BatchName “DB01toDB02”: This command, Get-Mailbox Creates a move request to move the mailboxes provided by the database to the target database named “DB02”.
    • -TargetDatabase DB02: Specifies the target database to be migrated. In this example, the mailboxes will be migrated to the “DB02” database.
    • -BatchName “DB01toDB02”: A name used to group and manage the migration process. This name is used to monitor and report the migration process.

Exchange Server Audit Log Mailbox Listing

  • Audit mailboxes, Exchange ServerThese mailboxes are known as special mail accounts that keep records of user actions on . These mailboxes are critical for security auditing and compliance requirements.
Get-Mailbox -Database "DB01" -AuditLog

Exchange Server Audit Log Mailbox Migration

Exchange Server Before deleting a database on Audit We also need to move LOG accounts to another database, we can use the following command for this process.

Get-Mailbox -Database "DB01" -AuditLog | New-MoveRequest -TargetDatabase "DB02" -BatchName "AuditLOGMbx"

Exchange Server Arbitration Mailbox Listing

  • Arbitration Mailboxes, Exchange Server These are mailboxes used for system operations and other administrative functions.

In the database Arbitration Mailbox to list and control;

Get-Mailbox -Database "DB01" -Arbitration

Exchange Server Arbitration Mailbox Migration

Arbitration MailboxesThe following command is used to move data from one database to another.

Get-Mailbox -Database "DB01" -Arbitration | New-MoveRequest -TargetDatabase "DB02" -BatchName "ArbitrationMbx"

This command will display all the data in the database “DB01” Arbitration Moves mailboxes to the “DB02” database.

Exchange Server Public Folder Listing

  • Public Folder Mailboxes, Exchange ServiceThese are private mailboxes in R that contain resources shared by users.

In a database Public Folder To list mailboxes:

Get-Mailbox -Database "DB01" -PublicFolder

This command will display all the data in the database “DB01” Public Folder Shows mailboxes.

Migrating PublicFolder Accounts in Exchange Server

Public Folder Mailboxes To move from one database to another:

Get-Mailbox -Database "DB01" -PublicFolder | New-MoveRequest -TargetDatabase "DB02" -BatchName "PublicFolder"

This command is in “DB01” Public Folder It is used to move mailboxes to “DB02”.

Listing Monitoring Mailbox in Exchange Server

  • Monitoring Mailboxs, Exchange Serverare special mailboxes that collect data about system health and performance.

To list Monitoring Mailbox accounts in Exchange Server:

Get-Mailbox -Database "DB01" -Monitoring

Exchange Server Monitoring Mailbox Migration

To disable Monitoring Mailboxes;

Get-Mailbox -Database "DB01" -Monitoring | Disable-Mailbox -Confirm:$false

Exchange Server Archive Mailbox Listing

  • Archive Mailboxes are known as special mailboxes used to store users' old emails.

In a database Archive To list mailboxes

Get-Mailbox -Database "DB01" -Archive

Exchange Server Archive Mailbox Migration

Archive To move mailboxes from one database to another;

Get-Mailbox -Database "DB01" -Archive | New-MoveRequest -TargetDatabase "DB02" -BatchName "ArchiveMbx"

List Move Requests in Exchange Server

Exchange ServerThe error we received while deleting the database in , is on the active accounts or the database we want to delete. Move If there is a desire, it happens.

Get-MoveRequestStatistics -MoveRequestQueue “Database-Name”

if Exchange Management Shell üzerinde Move Request If the Move requests have arrived, we can clear the Move requests with the following command.

Get-MoveRequest -ResultSize Unlimited | Where-Object {$_.Status -like “Completed”} | Remove-MoveRequest -Confirm:$false

After the above operations Exchange Server We can delete the database we want to delete without any problem. If the database is not deleted again after these operations, ADSI We need to process via .

Delete Exchange Server Database Using ADSI

What is ADSI?

ADSI Edit, Active Directory is an editor used to manage objects and attributes in your schema. This tool allows you to manipulate the deeper configuration settings of Active Directory and can often be thought of as a “registry editor for Active Directory.”

Especially, Active Directory Users and Computers It is used for some special settings that cannot be made via .

Steps to Delete MBX Database with ADSIEdit

  1. Login to Domain Controller:
    • Log in to your domain controller.
  2. Open ADSIEdit:
    • In the search bar on the start menu, type “ADSIEdit.mscRun the application by typing ”.
  3. Connection Setup:
    • In ADSIEdit, Action > Connect to follow the option.
    • "Select a well-known naming Context" under "ConfigurationSelect the ” option.
  4. Go to Database Location:
    • In the hierarchy, CN=Configuration > DC=mydomain > DC=Local follow your path.
    • CN=Services > Microsoft Exchange > mydomain > Administrative Groups > CN=Databases expand the location.
  5. Deleting Database:
    • Select the database you want to delete, right click and select “DeleteSelect ” option.
  6. Checking Replication Status:
    • Open Command Prompt and check if the replication is successful or not. repadmin /replsummary run the command.

With these operations Exchange Server We have successfully deleted the database we needed to delete. It is very important to be careful and not to cause any interruption in the system while performing all the operations described above.

Comment