Thursday, April 7, 2016

Stop unresponsive SharePoint 2013 service application service using PowerShell

In SharePoint we have Services on this Server page to manage different services like User Profile Service and SQL Server Reporting Services Service. Using that interface we can easily stop certain services from some servers and start them in other servers.

In one of my SharePoint farms, I needed to stop certain services in a particular server. I click on the stop link, but it was stuck in “Stopping”

image

I tried restarting SharePoint Timer Service and other remedies found in internet, but i was not that lucky.

I tried PowerShell as well.

First get the GUID of the required service application service using following command

Get-SPServiceInstance
I used following command to stop the service
Stop-SPServiceInstance -Identity "297f0d12-c09e-4182-8c42-e28065a36027"

image

There seems to be an unresponsive job. Let’s see the job first.

Get-SPTimerJob | where {$_.name -like "job-service-instance-297f0d12-c09e-4182-8c42-e28065a36027"}

image

Let’s delete the Job

$deleteJob = Get-SPTimerJob | where {$_.name -like "job-service-instance-297f0d12-c09e-4182-8c42-e28065a36027"}
$deleteJob.delete()

image

Then we will use PowerShell command to stop the service

Stop-SPServiceInstance -Identity "297f0d12-c09e-4182-8c42-e28065a36027"

image

After few seconds the service was stopped successfully

image

2 comments:

Yui-Ikari said...

T H A N K Y O U !!!! :)

TN said...

Thank you. This was veryhelpful