Problem
You check the Manage Profile Service page of your User Profile Service Application and note that the Profile Synchronization Status seems to be stuck on starting. You remove the connection that was used by the Profile Synchronization service that is now trying to start, but this doesn't change the status. You even try removing the User Profile Service application, but find that the User Profile Synchronization Service remains stuck on Starting.
Solution
You check the Manage Profile Service page of your User Profile Service Application and note that the Profile Synchronization Status seems to be stuck on starting. You remove the connection that was used by the Profile Synchronization service that is now trying to start, but this doesn't change the status. You even try removing the User Profile Service application, but find that the User Profile Synchronization Service remains stuck on Starting.
Solution
- Using the SharePoint Setup User Administrator account, log into the SharePoint server on which the User Profile Service application is running.
- Open an elevated SharePoint Management Shell.
- Execute Get-SPServiceInstance:
This returns a listing of service instances on all SharePoint servers. You can clean up the output by using: Get-SPServiceInstance | Where-Object {$_.Server -Like "*yourserver*"} | Select-Object TypeName, ID, status | Sort-Object TypeName
- Search through the listing returned by this command for User Profile Synchronization Service, and then note the Id for this service (not the UserProfileApplicationGuid).
- Execute Stop-SPServiceInstance -Identity <theID>:
- In Central Administration, navigate to Manage Services on Server. The service status should now be Stopping.
- Open the server Services applet.
- Restart the SharePoint Timer Service.
- Check Manage Services on Server again: after a few seconds, the status should change to Stopped.
While this stops the service, it does not stop the associated user profile import timer job, User Profile Service_ProfileSynchronizationJob, from still being run and generating a critical application error event 6398 every time. To stop this job, you can either remove the User Profile Service application or disable the job itself. To remove the UPA, use Central Administration's Manage Service Applications page. To disable the timer job, continue to the next step.
- Execute Get-SPTimerJob | Where-Object {$_.Schedule -Like "*1 minute*"} | Sort-Object Name | Select-Object name, ID, Status.
- Look for User Profile Service_ProfileSynchronizationJob, and then copy its ID.
- Execute Get-SPTimerJob -Identity <jobID> | Disable-SPTimerJob.
References
- Delete a service application in SharePoint 2013
- Delete the Service Applications of SharePoint 2013
- User Profile Database Architecture In SharePoint 2013
- Overview of the User Profile service application in SharePoint Server 2013
- Administer the User Profile service in SharePoint Server 2013
- Get-SPServiceApplication
- Remove-SPServiceApplication
- Restore a User Profile Service service application in SharePoint Server 2013
- Get-SPTimerJob
- Disable-SPTimerJob
- Troubleshoot User Profile Synchronization Service start issues (SharePoint Server 2010)
- Troubleshoot profile synchronization configuration issues (SharePoint Server 2010)
- SharePoint 2010 – Provisioning User Profile Synchronization
- Distributed Cache service stuck in Starting Provisioning
- User Profile Service Synchronization Service Stuck in "Stopping" State
Notes
- Stopping the service does not necessarily affect the import timer job.
- Update 03/02/16: I attempted to uninstall the User Profile Service Application from Central Administration by deleting the service application. This failed, and I then experienced the UPA being stuck on stopping. SharePoint Services on Server indicated that UPA was Stopping. Same in SharePoint Service Applications. Executing Stop-SPServiceInstance on the UPA service, the following error was presented:
Stop-SPServiceInstance : An object of the type Microsoft.SharePoint.Administration.SPServiceInstanceJobDefinition named
I was able to resolve this by launching an elevated command shell and executing this stsadm command:
"job-service-instance-5253819b-2e5b-49fe-b854-5970b970e97b" already exists under the parent
Microsoft.SharePoint.Administration.SPTimerService named "SPTimerV4". Rename your object or delete the existing object.
At line:1 char:1
...stsadm -o provisionservice -action stop -servicetype "Microsoft.Office.Server.Administration.ProfileSynchronizationService, Microsoft.Office.Server.UserProfiles, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" -servicename FIMSynchronizationService
as per this posting. When I then executed Get-SPTimerJob... it showed that the UPA service having a status of Disabled. When I checked the Sharepoint Services on Server status of UPA, it showed a status of Stopping. I then again attempted to delete the service application from Central Administration Service Applications, this time it completed successfully. - Synchronization Service Manager: tool useful for troubleshooting the SharePoint User Profile Service Application. You'll find it at this folder location:
\Program Files\Microsoft Office Servers\15.0\Synchronization Service\UIShell
Look for miisclient.exe. It enables you to view the real-time status of UPA processes, among many other things. I don't use it to manage FIM; just to view status information. For example, I have used to troubleshoot a UPA that failed to start. As I tried different troubleshooting steps, I monitored Synchronization Service Manager, watching in real-time to see how far UPA started, before stopping. It also provides helpful other information, such as confirmation of the Domain Controller that it is connecting to. If you configured UPA using Auto Detect for DC, you can now determine exactly which DC it is connecting to. You can also get confirmation of the service account that is running UPA (eg, the farm service account), and the number.