Exchange ServerTroubleshooting

Uninstalling an old Exchange server: mailboxes, connectors and errors that block removal

Exchange setup won't remove a server that still hosts hidden system mailboxes or DAG copies. Find them, move them, fix connectors and uninstall cleanly.

Once the mailboxes have moved to your new servers, removing the old Exchange server should be a formality, until setup's readiness checks stop with a long message about mailboxes you can't see. Here's what blocks the uninstall, the hidden mailbox types behind the error, the DAG and connector clean-up to do first, and how to confirm the server has gone cleanly.

Errors this guide fixes

  • This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxesExchange setup / Remove-MailboxDatabase
  • The feature you are trying to use is on a CD-ROM or other removable disk that is not available.Exchange setup (uninstall)
  • Insert the 'Microsoft Exchange Server' disk and click OK.Exchange setup (uninstall)
  • Event ID 2937 (MSExchange ADAccess)Application log+1 more guide
How this guide is organised: Symptoms → Why it happens → How to fix it → Verify the fix → Key takeawaysFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (6 steps: Inventory every mailbox on the old server; Move what has to move; Take the server out of the DAG; Re-point connectors and anything that sends SMTP to the server; Run the uninstall; Clean up afterwards). 4. Verify the fix. 5. Key takeaways. Toolbox: Event ID 2937, ExchangeSetup.log, Remove-MailboxDatabase, Remove-DatabaseAvailabilityGroupServer, Remove-DatabaseAvailabilityGroup.1Symptoms2Why it happens3How to fix it4Verify the fix5Key takeaways1Inventory everymailbox on th…2Move what hasto move3Take theserver out of…4Re-pointconnectors a…5Run theuninstall6Clean upafterwardsTOOLBOXEvent ID 2937ExchangeSetup.logRemove-MailboxDatabaseRemove-DatabaseAvailabilityGroupS…Remove-DatabaseAvailabilityGroupHow this guide is organised: Symptoms → Why it happens → How to fix it → Verify the fix → Key takeawaysFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (6 steps: Inventory every mailbox on the old server; Move what has to move; Take the server out of the DAG; Re-point connectors and anything that sends SMTP to the server; Run the uninstall; Clean up afterwards). 4. Verify the fix. 5. Key takeaways. Toolbox: Event ID 2937, ExchangeSetup.log, Remove-MailboxDatabase, Remove-DatabaseAvailabilityGroupServer, Remove-DatabaseAvailabilityGroup.1Symptoms2Why it happens3How to fix it1Inventory every mailbox on the old server2Move what has to move3Take the server out of the DAG4Re-point connectors and anything that sendsSMTP to the server5Run the uninstall6Clean up afterwards4Verify the fix5Key takeawaysTOOLBOXEvent ID 2937ExchangeSetup.logRemove-MailboxDatabaseRemove-DatabaseAvailabilityGroupServerRemove-DatabaseAvailabilityGroup
At a glance: how this guide is organised · 6 fix steps · 5 key tools

Symptoms#

Uninstall (from Control Panel › Programs and Features or Setup.exe /Mode:Uninstall) fails its readiness checks with an error like this. You get the same text if you run Remove-MailboxDatabase yourself:

Text
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 Audit mailboxes in this database, run the command
Get-Mailbox -Database <Database ID> -AuditLog. ...

Related problems on the same job:

  • A Windows Installer prompt: The feature you are trying to use is on a CD-ROM or other removable disk that is not available. followed by Insert the 'Microsoft Exchange Server' disk and click OK.
  • Setup refuses to continue because the server is still a member of a database availability group (DAG).
  • No error, but afterwards outbound mail queues because a Send connector lost its only source server, or a scanner relaying through the old server stops sending.

Why it happens#

Uninstall has to remove the server's mailbox databases, and Exchange won't delete a database that still hosts user, archive, public folder, arbitration or audit mailboxes. The catch is that plain Get-Mailbox -Database only returns ordinary mailboxes. System mailboxes hide behind switches:

Mailbox typeHow to list itAction
Arbitration (system) mailboxes: approvals, migrations, OAB generation and moreGet-Mailbox -ArbitrationMove
Audit log mailboxesGet-Mailbox -AuditLogMove
Public folder mailboxesGet-Mailbox -PublicFolderMove
Archives stored in this database (primary elsewhere)Filter on ArchiveDatabaseMove archive only
Health (monitoring) mailboxesGet-Mailbox -MonitoringDon't move; Managed Availability owns them

The Windows Installer prompt has a different cause: the installer needs the original media for the CU that's currently installed and can't find it.

How to fix it#

1. Inventory every mailbox on the old server#

In a multi-domain forest, widen the shell's scope first or you'll miss mailboxes in other domains. Then check each database on the server:

PowerShell
Set-ADServerSettings -ViewEntireForest $true
Get-MailboxDatabase -Server EX2016-01 | Format-Table Name, Server

$db = 'DB2016-01'
Get-Mailbox -Database $db -ResultSize Unlimited | Format-Table Name, RecipientTypeDetails
Get-Mailbox -Database $db -Arbitration | Format-Table Name, Database
Get-Mailbox -Database $db -AuditLog | Format-Table Name, Database
Get-Mailbox -Database $db -PublicFolder | Format-Table Name, Database
Get-Mailbox -ResultSize Unlimited | Where-Object { $_.ArchiveDatabase -eq $db } |
  Format-Table Name, Database, ArchiveDatabase

2. Move what has to move#

PowerShell
$target = 'DBSE-01'
$batch  = 'Decom-EX2016-01'
Get-Mailbox -Database $db -ResultSize Unlimited | New-MoveRequest -TargetDatabase $target -BatchName $batch
Get-Mailbox -Database $db -Arbitration  | New-MoveRequest -TargetDatabase $target -BatchName $batch
Get-Mailbox -Database $db -AuditLog     | New-MoveRequest -TargetDatabase $target -BatchName $batch
Get-Mailbox -Database $db -PublicFolder | New-MoveRequest -TargetDatabase $target -BatchName $batch
Get-Mailbox -ResultSize Unlimited | Where-Object { $_.ArchiveDatabase -eq $db -and $_.Database -ne $db } |
  New-MoveRequest -ArchiveOnly -ArchiveTargetDatabase $target -BatchName $batch

Get-MoveRequest -BatchName $batch | Get-MoveRequestStatistics |
  Format-Table DisplayName, StatusDetail, PercentComplete -AutoSize

When everything shows Completed, clear the requests with Get-MoveRequest -BatchName $batch | Remove-MoveRequest. Then remove the databases yourself with Remove-MailboxDatabase: if anything is left, you get the same error much faster than through setup. The cmdlet doesn't delete the .edb and log files; delete those later.

Note: If this is the last Exchange server in the organization, different rules apply, especially in hybrid. See removing the last Exchange server in hybrid.

3. Take the server out of the DAG#

PowerShell
Get-MailboxDatabaseCopyStatus -Server EX2016-01 | Format-Table Name, Status
Move-ActiveMailboxDatabase -Server EX2016-01            # if it still holds active copies
Remove-MailboxDatabaseCopy -Identity 'DB2016-02\EX2016-01' -Confirm:$false
Remove-DatabaseAvailabilityGroupServer -Identity DAG2016 -MailboxServer EX2016-01

If the server is already dead, Remove-DatabaseAvailabilityGroupServer has a -ConfigurationOnly switch; you then evict the node from the Windows failover cluster as well. When you remove the last member, delete the DAG with Remove-DatabaseAvailabilityGroup.

4. Re-point connectors and anything that sends SMTP to the server#

PowerShell
Get-SendConnector | Format-Table Name, SourceTransportServers -AutoSize
Set-SendConnector -Identity 'Internet' -SourceTransportServers EXSE-01, EXSE-02
Get-ReceiveConnector -Server EX2016-01 | Format-Table Name, Bindings, RemoteIPRanges -AutoSize
  • Custom Receive connectors (relay, partner TLS) belong to the server and disappear with it. Recreate them on the new servers, then use the SMTP receive protocol logs under %ExchangeInstallPath%TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive (with protocol logging enabled on the connector) to find devices still connecting to the old server.
  • In hybrid, re-run the Hybrid Configuration Wizard and choose the new servers for transport rather than editing the hybrid connectors by hand (see Exchange hybrid mail flow).
  • Take the server out of load balancer pools, DNS records, firewall rules, backup jobs and monitoring.

5. Run the uninstall#

Mount the ISO of the CU that's installed on the old server (Get-ExchangeServer EX2016-01 | Format-List AdminDisplayVersion tells you which). That avoids the "Insert the 'Microsoft Exchange Server' disk" prompt; if it still appears, browse to the mounted media. Then, from an elevated prompt:

Command Prompt
D:\Setup.exe /Mode:Uninstall /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF

If it fails, read the end of C:\ExchangeSetupLogs\ExchangeSetup.log or run SetupLogReviewer.ps1 from Microsoft's CSS-Exchange scripts against it.

6. Clean up afterwards#

  • Health mailboxes whose database no longer exists can be deleted from Microsoft Exchange System Objects › Monitoring Mailboxes in Active Directory Users and Computers (turn on View › Advanced Features if you can't see it). Left behind, they tend to surface as MSExchange ADAccess warnings (Event ID 2937) about attributes pointing to deleted objects.
  • If a server died and can't be uninstalled, the supported route is to rebuild it with the same name, run Setup.exe /Mode:RecoverServer and then uninstall properly. Deleting objects with ADSI Edit is a last resort.

Verify the fix#

PowerShell
Get-ExchangeServer | Format-Table Name, AdminDisplayVersion -AutoSize
Get-MailboxDatabase | Format-Table Name, Server -AutoSize
Get-DatabaseAvailabilityGroup | Format-Table Name, Servers -AutoSize
Get-SendConnector | Format-Table Name, SourceTransportServers -AutoSize
Get-Mailbox -Arbitration | Format-Table Name, ServerName, Database -AutoSize

Good looks like this: the old server appears nowhere in that output, the arbitration mailboxes sit on the new servers, test messages flow both ways, Get-Queue is clean and Outlook still connects.

Key takeaways#

  • Arbitration, audit and public folder mailboxes, and archives stored apart from their primary mailbox, don't appear in a plain Get-Mailbox -Database.
  • Empty and remove the databases yourself before running setup.
  • Fix Send connectors, relay devices and hybrid settings before the server disappears.
  • Keep the ISO of every CU you install; uninstall needs it.
  • Migrating from Exchange 2016? This is the last step of moving from Exchange 2016 to Exchange Server SE.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)