Archive for July, 2011

Stopping SharePoint 2010 Service Applications Using PowerShell

July 29, 2011 Leave a comment

If you ever have problems stopping a service application service within SharePoint 2010 follow below on how to use PowerShell to manually stop the service.

I’m currently rebuilding my Pilot SharePoint 2010 farm and I got to the dreadful User Profile Synchronization configuration step.  I will not go into detail on how to configure the User Profile Synchronization configuration on this post, but I will blog about this monster later.

Anyways long story short the User Profile Synchronization Service was stopped and I needed to restart it so I clicked on the “Start”  link next to the User Profile Synchronization Service to start the service, after filling in the required fields and clicking the ok  button the status changed from “Stopped” to “Starting”…..however after waiting 10+ minutes (sometimes it takes time to process) the “Starting”  status never  changed its status to “Started”.  This told me something is wrong with the User Profile Synchronization Service App.

Since there is no way within Central Administration to stop the service from the “Starting” status you have to use PowerShell to manually stop it or else the status will remain in “Starting” status.

1.  Bring up a SharePoint 2010 Management Shell (PowerShell) Shell.
2.  Type: get-spServiceInstance and hit enter (This will list all the Service Application Services along with their Status and ID (GUID)).
3.  Right click inside the PowerShell window and select “Mark”
4.  Next find the ID (GUID) for whichever Service Application Service is stuck in “Starting” status.
5.  Highlight the ID(GUID) and right click again.  This will paste the ID (GUID) into the clipboard.
6.  Now type: stop-spServiceInstance -identity GUID (Here you will paste the ID (GUID) you just copied from Step 5.  Right click inside the PowerShell Shell and select “paste”.
7.  Your line should look something like this:  stop-spServiceInstance -identity 1df82d5e-1011-4395-9cf7-d4635aa59c02
8.  Hit enter
9.  You will then be prompted to confirm:

Are you sure you want to perform this action?
Performing operation “Stop-SPServiceInstance” on Target “Name of Service Application”
[Y] Yes [A]Yes to All [N] No [L] No to All [S] Suspend [?] Help
<default is “Y”>:

Type: Y at this stage and hit enter.

10.  The Service Application Service has now been stopped.  Double check Central Administration to see if the service is indeed stopped.