Migrating to M365 / OneDrive for Business
After my migration to M365, I had trouble signing into OneDrive Sync
I recently upgraded my environments from on-premise Exchange to M365. I had Azure ADConnect installed on the server, password synchronisation installed and then the M365 migration continued. I must admit that I left the OneDrive parts until a later date, being able to live with what I have now. When I went to move from OneDrive personal to business, I ran into a big issue in that OneDrive Sync on the PC couldn't sign in. I was able to sign in with a browser, and I also managed to get it to work on my Apple devices (Mac, iPhone etc).
One of the "big" issues was that I had both a Microsoft Personal account and an Azure account with the same email address. I have "managed" like this over the years, but it has finally bitten me. So the first step was to change the email address on the personal account to something outside my domain. Sadly, this didn't cure the issue and I was still unable to login.
The next suggestion was to delete any stored "Windows Credentials" - these can be found in the Control Panel under users. This also didn't work and on a second PC, I discovered it to be unnecessary.
Finally, in this thread, a long way down, I found the suggestion to delete the OneAuth and Identity Cache folders in the below location.
%localappdata%/Microsoft/OneAuth%localappdata%/Microsoft/IdentityCache
After deleting the folders, I rebooted and tried the login again and this time I was successful.