Forum Discussion

mrlovett's avatar
mrlovett
Copper Contributor
Aug 28, 2025
Solved

Request for Official Cleanup Script to Retire Exchange 2016 After Migrating to Exchange SE

 

Subject: Request for Official Cleanup Script to Retire Exchange 2016 After Migrating to Exchange SE

Hi Exchange Team,

I've successfully migrated mail flow and management to Exchange Server Subscription Edition (SE) and am now preparing to retire our legacy Exchange 2016 server (EXCHANGE2016). I’ve followed the documented steps from the Decommissioning Exchange Server 2016 blog post, but I recall that a script—Cleanup-ExchangeLegacyServer.ps1—was referenced or released separately to automate the final cleanup. I’m unable to locate the actual script and would appreciate guidance on where to find it.

Here’s a summary of what I’ve completed so far:

Steps Completed

  1. Mail Flow Migration
    • Reconfigured send connectors: Set-SendConnector "Outbound to Office 365" -SourceTransportServers @("EXCHANGESE")
    • Verified SmartHost routing and TLS settings.
  2. Receive Connector Cleanup
    • Disabled all receive connectors on EXCHANGE2016: Get-ReceiveConnector -Server EXCHANGE2016 | Disable-ReceiveConnector
  3. Mailbox Migration
    • Moved all user, arbitration, audit log, and monitoring mailboxes: Get-Mailbox -Server EXCHANGE2016 Get-Mailbox -Server EXCHANGE2016 -Arbitration Get-Mailbox -Server EXCHANGE2016 -AuditLog Get-Mailbox -Server EXCHANGE2016 -Monitoring
  4. Queue Validation
    • Confirmed no active queues on EXCHANGE2016.
  5. Connector Scope Audit
    • Verified EXCHANGE2016 is no longer listed in any send connector: Get-SendConnector | Where-Object {$_.SourceTransportServers -contains "EXCHANGE2016"}

Remaining Question

Should I now:

  • Run an official cleanup script (e.g., Cleanup-ExchangeLegacyServer.ps1) to safely remove EXCHANGE2016’s configuration objects while keeping Exchange SE intact?
  • Or simply uninstall Exchange 2016 from EXCHANGE2016 and decommission the server manually?

I want to ensure I follow Microsoft’s best practices and avoid breaking hybrid management or leaving orphaned AD objects. If the script is available, could you please share the official download link and any updated guidance?

Thanks in advance for your help!

—Michael

 

  • I'm not aware of any script. All you need to do is uninstall Exchange from the server...this will take care of all the objects related to that server in AD.

2 Replies

  • Dan_Snape's avatar
    Dan_Snape
    Iron Contributor

    I'm not aware of any script. All you need to do is uninstall Exchange from the server...this will take care of all the objects related to that server in AD.

    • mrlovett's avatar
      mrlovett
      Copper Contributor

      Thank You, we followed your advise, and all is well in the world:

      Decommissioning Exchange Server 2016 | Microsoft Community Hub

      PS E:\> .\Setup.exe /mode:Uninstall /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF

      Microsoft Exchange Server 2016 Cumulative Update 23 Unattended Setup

      Mailbox role: Mailbox service
      Mailbox role: Unified Messaging service
      Mailbox role: Client Access service
      Mailbox role: Transport service
      Mailbox role: Front End Transport service
      Mailbox role: Client Access Front End service
      Management tools
      Languages

      Performing Microsoft Exchange Server Prerequisite Check

          Configuring Prerequisites                                                                         COMPLETED
          Prerequisite Analysis                                                                             COMPLETED

      Configuring Microsoft Exchange Server

          Preparing Setup                                                                                   COMPLETED
          Mailbox role: Mailbox service                                                                     COMPLETED
          Mailbox role: Unified Messaging service                                                           COMPLETED
          Mailbox role: Client Access service                                                               COMPLETED
          Mailbox role: Transport service                                                                   COMPLETED
          Mailbox role: Front End Transport service                                                         COMPLETED
          Mailbox role: Client Access Front End service                                                     COMPLETED
          Exchange Management Tools                                                                         COMPLETED
          Language Files                                                                                    COMPLETED
          Stopping Services                                                                                 COMPLETED
          Removing Exchange Files                                                                           COMPLETED
          Restoring Services                                                                                COMPLETED
          Finalizing Setup                                                                                  COMPLETED

      The Exchange Server setup operation completed successfully.

Resources