# Office 365 Exchange Hybrid Migration -Decom NOTE: This page is for the cleanup of a Hybrid migration. This is expected to be the phase AFTER completing the mailbox migrations. [Office 365 Exchange Migration -Hybrid](onenote:#Office%20365%20Exchange%20Migration%20-Hybrid%20%20§ion-id=%7B7E1835FA-F5B5-418D-A722-C4DAE6328A32%7D&page-id=%7BC2673477-B601-45BA-90C1-7FA186A6D427%7D&end&base-path=X:%5CTier1%5COneNote%5CTech%20Information%5CTech%20Information%5CGeneric%20Tech%5COffice%20365.one) qKzeWcMcrkNayZZW Make sure no devices are using your old Exchange on-premise server Exchange Powershell: [Get-Message](onenote:Exchange.one#Get-Message§ion-id=%7B7F32CB07-5942-4FDC-AEAF-7B1062D58518%7D&page-id=%7B805610E0-EDC2-428F-80ED-B196DF072F3F%7D&end&base-path=https://accentconsultingservices.sharepoint.com/sites/Accent_ALL/Shared%20Documents/Accent_ALL/Tier1/OneNote/Tech%20Information/Tech%20Information/Generic%20Tech) Coordinate with client and turn off the Exchange Server for a period of time to verify no email flow conclusively. Prepare Your Office 365 Environment for the Removal of the Last Exchange On-Premises Server Follow these steps to remove dependencies on your on-prem Exchange environment: Confirm you have no public folders on your on-prem Exchange server (move them to Office 365 if they exist) Confirm you have no more mailboxes on your on-prem Exchange server Confirm that no scan-to-mail devices, applications, etc. are using your on-premises Exchange server to relay emails DNS MX Autodiscover SPF Remove the Service Connection Point values from Exchange: Get-ClientAccessServer | Set-ClientAccessServer -AutoDiscoverServiceInternalUri $Null Remove (or disable) Exchange on-prem inbound and outbound connectors from your Office 365 environment (done via the Connectors page in the EAC – the connectors created by the Hybrid Connection Wizard are named “Inbound from ” and “Outbound to “) Remove the Organization Relationship from Office 365 using the Office 365 Portal (the Organization Relationship created by the Hybrid Connection Wizard is named “O365 to On-Premises – “ If OAuth is enabled make sure to disable it on both on-prem and in Exchange Online: Get-IntraorganizationConnector -Identity ExchangeHybridOnPremisesToOnline | Set-IntraOrganizationConnector -Enabled $False Get-IntraorganizationConnector -Identity ExchangeHybridOnlineToOnPremises | Set-IntraOrganizationConnector -Enabled $False Once these steps are completed you can remove the on-prem Exchange server. Clean Removal of the Last On-Premises Exchange Server A clean removal of Exchange is the preferred solution. This will ensure relevant Active Directory objects are removed properly. The clean removal is started simply by uninstalling Exchange from the last Exchange server in your organization (make sure you completed the steps in the previous section to prepare for the removal). Launching the Exchange uninstaller (from Add/Remove Programs) will trigger a readiness check which checks for any remaining mailboxes, any remaining mailbox databases, etc. Make sure to get rid of your arbitration mailboxes to complete the uninstall: Automate: Set to Maintenance Mode See what mailboxes are left Get-Mailbox Get-Mailbox -Archive Get-Mailbox -PublicFolder Get-Mailbox -AuditLog Get-Mailbox -Monitoring Remove or Disable Mailboxes Get-Mailbox | Remove-Mailbox Disable-Mailbox Get-OfflineAddressBook Get-OfflineAddressBook | Remove-OfflineAddressBook Get-Mailbox -Arbitration | Remove-Mailbox -Arbitration -RemoveLastArbitrationMailboxAllowed Get-Mailbox -Arbitration | Disable-Mailbox –Arbitration –DisableLastArbitrationMailboxAllowed Once the readiness check is successful it will remove the Exchange configuration from AD and remove Exchange binaries from the server. Remove from Domain Turn off Disable Backups, Notifications, & Reports Disable any related processes that are no longer used (Barracuda) Remove from CRM [https://www.easy365manager.com/remove-on-prem-exchange-from-hybrid-environment/](https://www.easy365manager.com/remove-on-prem-exchange-from-hybrid-environment/) Notes found randomly that pertain but need reviewed: \#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 From <[https://www.itpromentor.com/sbs-remove-exchange/](https://www.itpromentor.com/sbs-remove-exchange/)>