
NelsonW.60321 (Customer) asked a question.
Is anyone aware if the AzureAD Set-MsolDirSyncEnabled command will impact current Okta integration using O365? We need to break all prior syncs from our Windows AD when we were using ADConnect, but we cannot afford to impact objects currently being synced by Okta.

Federation redirects to the IDP, i.e. Okta. If you break dirsync and Okta is NOT doing the provisioning, you shouldn't have an issue. We've successfully broke dirsync when Okta was responsible for provisioning with no issues in re to federation. We just made sure deactivate users is never set in the Okta O365 API config. LMK if this helps...
Thanks for the quick reply Jeff. Sadly we are provisioning with Okta. (Afterthought. We originally granted access to O365, but then came back with project to add-on provisioning as a second app in Okta.) So we're Universal Sync and it seems to be working well, but I have quite a few objects in O365/Azure AD synced from on-prem that we cannot update or remove since we killed ADConnect once we went Federated.
I like your idea to make to sure DEACTIVATE USERS is not set before we make any changes like this. So procedurally, I'd disable that, run the Azure AD command to stop sync, then verify my changes in Okta are still syncing to O365. At that point, all O365 objects not controlled by Okta should now show as cloud based objects that I can manage as we see fit.
Sound good or am I missing something destined to bite me back? MSFT support through it over the fence and said this will work but they could not say it would not break Okta integration, not that I expected Support to speak for anyway.
You're plan should work. Keep in mind that once you disable dirsync, you need to wait 72 hours before enabling Okta to manage the objects (https://docs.microsoft.com/en-us/microsoft-365/enterprise/turn-off-directory-synchronization?view=o365-worldwide).
The following commands will show you if dirsync is disabled. It is important to make sure it says disabled or false and NOT pending disabled.
(Get-MSOLCompanyInformation).DirectorySynchronizationStatus
(Get-MsolCompanyInformation | select DisplayName,DirectorySynchronizationEnabled,DirSyncServiceAccount,LastDirSyncTime)
If you need to remove objects after you disable dirsync, you can use the followinf command:
Remove-MsolUser -UserPrincipalName user@domain.com -RemoveFromRecycleBin
Remove-MsolUser -UserPrincipalName user@domain.com -RemoveFromRecycleBin -force