Skip to content

Instantly share code, notes, and snippets.

@irlperu
Last active August 9, 2019 15:07
Show Gist options
  • Save irlperu/67bcb8e8a342b99b86f2737000265aa1 to your computer and use it in GitHub Desktop.
Save irlperu/67bcb8e8a342b99b86f2737000265aa1 to your computer and use it in GitHub Desktop.
Turn off AD Connect and leave users as Cloud Only
# https://support.microsoft.com/en-us/help/2619062/you-can-t-manage-or-remove-objects-that-were-synchronized-through-the
# Connect to AAD
Connect-MsolService
# Disable AAD Connect Sync atAAD Level -- This will set users to be Cloud Only
Set-MsolDirSyncEnabled -EnabledDirSync $false
# To Check the Status of the previous command, run the following command
(Set-MsolDirSyncEnabled).DirectorySynchronizationEnabled
# To re-enable AAD Connect syncronization
Set-MsolDirSyncEnabled -EnableDirSync $true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment