The first thing to do is to launch PowerShell as an Administrator, and once inside, there are only two simple commands to provide. An Azure/Office 365 Global Admin account will be required, so be sure to have one handy.
These commands require the MSOnline module. If you don’t have this module installed, simply run the following in PowerShell:
This will result in a prompt notifying that an untrusted repository is being used for the module installation. Answering yes will allow the installation.
Once the module is installed, the below can be run to connect to Azure.
$Msolcred = Get-credential
Connect-MsolService -Credential $MsolCred
A pop-up Window will appear. This is where Global Admin credentials are required. Providing the correct credentials will return focus to PowerShell.
Next, Directory Sync can be disabled by entering the below in PowerShell.
Set-MsolDirSyncEnabled –EnableDirSync $false
Note that setting the above value to true would enable Azure AD Sync.
To see that AD Connect and Sync has been disabled, the following can be used:
The below screenshot shows the above steps within PowerShell: