So after many an hour of playing with this I wanted to share how I managed to resolve the issue of starting the User Profile service.
Couple of things to make you aware of early on:
- This is not a conclusive guide on how to setup user profile service application
- I used to the SharePoint Farm account to start the service (other accounts fail)
- The User Profile Service Application was run under an application pool account under a separate AD account
- SQL on the same server
- Windows 2008 R2 with hot fix for WCF (KB976462)
- I ran the wizard to install SharePoint 2010 (creating the user profile service application for me)
So following a series of excellent posts from Spencer Harbar on setting up and providing the correct permissions for the user profile implementation to succeed I hit an error where i couldn't start the user profile service, well I could but it wouldn't stay in a state of ‘started’ for long. Trawling the event viewer application logs 2 noticeable errors were showing each time I attempted to start the service these were:
Event ID 6306 - FIMSynchronizationService
The server encountered an unexpected error while performing an operation for the client.
"BAIL: MMS(7132): mastate.cpp(3117): 0x80230622 (A management agent with this name already exists.): MA directory cannot be created because it is already in use by an existing MA: C:\Program Files\Microsoft Office Servers\14.0\Synchronization Service\MaData\ILMMA
BAIL: MMS(7132): mastate.cpp(1637): 0x80230622 (A management agent with this name already exists.)
BAIL: MMS(7132): server.cpp(964): 0x80230622 (A management agent with this name already exists.)
Forefront Identity Manager 4.0.2450.5"
Event ID 3 – Forefront Identity Manager
Microsoft.ResourceManagement.ResourceManagementException: Exception from HRESULT: 0x80230622 ---> System.Runtime.InteropServices.COMException (0x80230622): Exception from HRESULT: 0x80230622
at MIISRCW.IMMSServer.CreateMA(String pszMADataXML, String& ppszUpdatedXML)
at Microsoft.ResourceManagement.SyncConfig.CreateMA(String maData, String& returnString)
at Microsoft.ResourceManagement.ActionProcessor.SyncConfigActionProcessor.Create(String typeName, IList`1 createParameters, Guid creator, Guid cause)
--- End of inner exception stack trace ---
After hours of changing security permissions and adding users to different groups to try and resolve this I finally made a breakthrough!
To resolve this issue what I did was delete the User Profile Service Application from the Service Application page and recreated it. IMPORTANT recreating the user profile servie application with exactly the same name will result in these errors reappearing so I advise that when recreating you give the service application a different name.
Reading between the lines it looks as if somewhere in the configuration it thinks that the user profile service application is either already started and therefore fails when attempting to start it with exactly the same name.
I really hope this helps you out as this one was really frustrating for me!
Related articles worth reading