When moving mailboxes to exchange online, you will probably get errors like this

“A corrupted item was encountered: Unable to translate principals for folder”

Some of these errors occur for a reason that all the users which have permissions to other user mailbox folders (example calendars), have not been synced to O365. Or there might be a permissions for users which account have been deleted.

This script finds and removes these “Legacy Permissions”. It won´t work for a freebusy and other non ipm subtree folders.

** Updated! 27022019 **