A small tidbit, today I was unable to edit a user that was sourced from the local AD and synced to Office 365. The message displayed was that the user was outside my organisation, and thus not editable.
Closer inspection using powershell and Get-Msoluser showed that her UserType was set to ‘Guest’. I checked all her AD properties and the dirsync logs, but there was no explanation for this status.
I used Set-MsolUser -UserPrincipalName firstname.lastname@example.org -UserType Member to make her account writable again. Successive dirsyncs did not reset the UserType property.