There is 2 scripts for powershell that suppose to use before going to dirsync. One is a read only that suppose to compare your active directory to the cloud and look for errors and the other one is the cleanup script that you use to correct errors. Microsoft said that is optional but in reality, you need it because in dirsync, there is 4 fields that change and need to remap.
Prepare your directory for upgrade - Upgrade to Office 365 - Office 365 - Microsoft Office 365 Community