Unable to start User Profile Synchronization Service

1 minute read

A few days ago I wrote a post about loading modules in PowerShell by default: “Load modules by default when opening PowerShell”. Today we had to setup a new SharePoint Farm and to perform some default operations we created the PowerShell profile described in that post.

The complete configuration of the server went well until we wanted to start the “User Profile Synchronization Service”. The Service moves to starting and the timer job that configures the service also starts but after 5 seconds it already stops.

Looking at the ULS log we found this error message:

“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.
at Microsoft.Office.Server.UserProfiles.Synchronization.ILMPostSetupConfiguration.ConfigureMiisStage2()
at Microsoft.Office.Server.Administration.UserProfileApplication.SetupSynchronizationService(ProfileSynchronizationServiceInstance profileSyncInstance).”

This message did not gave us a clue at all. At the same time we were working on the PowerShell Profiles and had temporary removed our custom profile from the service.

Provisioning the “User Profile Synchronization Service” without the custom profile resulted in success. So remember when you want to provision the “User Profile Synchronization Service” make sure you are not using a custom PowerShell profile.