1281 Baring BLVD, Sparks NV 89434

Removing Office 365 Premise AD Server

So your on-premise AD Server using Azure AD Connect is now offline for some reason like a complete failure from ransomware or hard drive failure. Use the following commands to quit syncing and get full control of your AD in the cloud using Azure.

Prerequisites

  • Windows 10 Desktop with administrator rights in Windows Powershell
  • User account with Office 365 tenant Global Administrator rights.

Run the following in Windows 10 desktop Powershell:

  1. Install-Module MSOnline
  2. Connect-MsolService
  3. Set-MsolDirSyncEnabled -EnableDirSync $false

Your results should look similar to the following.:

Windows PowerShell
 Copyright (C) Microsoft Corporation. All rights reserved.
 Try the new cross-platform PowerShell https://aka.ms/pscore6                                                                                                                                               
 PS C:\WINDOWS\system32> Install-Module MSOnline
 Untrusted repository
 You are installing the modules from an untrusted repository. If you trust this repository, change its
 InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
 'PSGallery'?
 [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
 PS C:\WINDOWS\system32> Connect-MsolService
 PS C:\WINDOWS\system32> Set-MsolDirSyncEnabled -EnableDirSync $false
 Confirm
 Continue with this operation?
 [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y
 PS C:\WINDOWS\system32>

Note: It may take up to 24 hours for the users to change over from the premise AD to Azure AD.