How to properly remove Exchange 2007/2010 from SBS 2008/2011 after migration to Office 365Alex Fields
Most small businesses that were invested in the Small Business Server (SBS) platform are migrating to Office 365. This means they no longer need to keep their on-premises Exchange Server. However, there is a proper way to remove the Exchange services from the SBS server before you dismantle it for good.
- Exchange should be removed before AD/DNS: The uninstall procedure needs to be done in advance of removing Active Directory roles from the SBS server;
- Windows Server editions: Note that this procedure is also valid for removing the last legacy Exchange 2007 / 2010 Server from Windows Standard / Enterprise / Datacenter editions;
- Hybrid/Remote Move Migrations: if you had performed a Remote Move migration from SBS 2011 or Exchange 2010, then you need to follow a slightly different procedure, to ensure that Directory synchronization and the hybrid relationship is properly retired before uninstall. Therefore, only proceed with the below if you are positive that you do not have a hybrid connection, and/or Directory Synchronization in place. Alternatively, you may consider keeping a free Exchange server on-premises to maintain the hybrid connection.
Prepare Exchange for Uninstall
You will need to run several PowerShell commands to help prepare your server for uninstall. Warning: this assumes all data has been migrated to Office 365, and you have no further need of Exchange data / services on-premises. Proceed at your own risk.
Open the Exchange Management Shell as Administrator, and run the following PoSH snippets in this order for SBS 2008/2011 or Exchange 2007/2010, answering prompts for confirmation in the affirmative for all (A).
#Remove default Public folders Get-PublicFolder "\" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Recurse -ErrorAction:SilentlyContinue #Remove system Public folders Get-PublicFolder "\Non_Ipm_Subtree" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Recurse -ErrorAction:SilentlyContinue #Remove Offline Address Book Get-OfflineAddressBook | Remove-OfflineAddressBook #Remove send connectors Get-SendConnector | Remove-SendConnector #Remove Public Folder database (SBS 2011/Exchange 2010 Only) Get-PublicFolderDatabase | Remove-PublicFolderDatabase #Remove arbitration mailboxes (SBS 2011/Exchange 2010 Only) Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed #Remove mailboxes Get-Mailbox | Disable-Mailbox
Now you are ready to run the uninstaller. From an elevated command prompt, navigate to the directory “C:\Program Files\Microsoft\Exchange Server\Bin” or “C:\Program Files\Microsoft\Exchange Server\v14\Bin” and run:
That should be it. After Exchange is fully removed, you can proceed with the rest of the decom process, which will be covered in an upcoming post.