Recently I was at a customer site and ran into an issue with the User Profile Synchronization Service failing to start. We found the following error in the SharePoint ULS logs:
UserProfileApplication.SynchronizeMIIS: Failed to configure MIIS post database, will attempt during next rerun. Exception: System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception
The problem ended up being a PowerShell profile that had been created for the SharePoint Farm account. The fact that the PoweShell profile existed was fine but the customer was mapping drives within the profile. The drive mapping was the culprit. We were able to verify this by following these steps:
I have seen a lot of posts on similar issues with the User Profile Synchronization Service not starting but none that resolved our problem. Hopefully this will help others having this problem.