How to Decomission On-Prem Exchange Server after migrating the Mailboxes to O365

November 6, 2018 at 11:34 am Leave a comment

Few weeks ago, we had project to migrate the Exchange 2010 Mailboxes to O365. After the  migration completed  we had to remove the On-Prem Exchange Servers(Even though it is not a supported scenario from Microsoft , still you could do this.) This will lead you to to adopt non standard methods when creating new mailboxes(Refer my post https://vands.pro/2018/11/06/how-to-create-an-o365-mailbox-when-there-is-no-on-prem-exchange-servers/ for detailed steps). Also if you still needed an Exchange Server in your premises to avoid complication you could contact MS O365 Support to obtain a free Exchange Hybrid License and install an Exchange Server.

Coming back to the original goal of this article you need to follow the below steps if you have decided to remove the Exchange Servers; Also note that uninstallation of Exchange will not impact the O365 mailboxes in any manner.

+ By this time you should have changed the MX and related DNS records on 
    the on-prem DNS and Public DNS Servers.

+ Set the AD Internal URL to null
  Get-ClientAccessServer | Set-ClientAccessServer 
  -AutoDiscoverServiceInternalUri $Null

+  Then disable the AD Sync(Temporarily)
    Set-MsolDirSyncEnabled -EnableDirSync $false
    (Get-MsolCompanyInformation).DirectorySynchronizationEnabled – To
    view the current status.

+ Open Exchange Shell in one of the Exchange Server(uninstallation should
  be started in the order of MBOX,CAS,HUB & Edge)

+ 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

Get-PublicFolderDatabase | Remove-PublicFolderDatabase

+ + Remove Arbitration Mailbox

Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed

+ Disable / Delete All non migrated Mailboxes

Get-Mailbox | Disable-Mailbox

+ Open CMD as Administrator and Go to the bin folder in the Exchange Installation Folder in your C: drive(Depend on your environment)
   
  setup.com /m:unistall.

+ Once all the Exchange Roles are uninstalled disjoin the servers from the AD.

+ Re-run the AD Sync Tool and remove the Tick on Exchange Hybrid Configuration.

+ Re-enable the AD Sync

  Set-MsolDirSyncEnabled -EnableDirSync $false

 

Credits: https://www.itpromentor.com/remove-hybrid-keep-sync/

Good Luck Guys.

 

 

 

 

 

Advertisement

Entry filed under: Exchange and O365. Tags: , .

Azure AD Password Sync Error with Event ID 611 How to create an O365 Mailbox when there is no On-Prem Exchange Servers.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trackback this post  |  Subscribe to the comments via RSS Feed


Archives

Categories

Follow Hope you like it.. on WordPress.com

Blog Stats

  • 68,224 hits

%d bloggers like this: