kill windows service stuck at stopping

Every infracture admin need to know the steps to force stop or kill windows service stuck at stopping by pid using taskkill or powershell. Think about a situation, you are trying to stop a windows service but its stuck at stopping status. Means service stopping hung and not responding. In this case we need to force kill windows service either by using taskkill in command line (cmd) or by powershell. Follow the step by step commands to apply in cmd for force stop service windows server.

Advertisements

Run command prompt as an administrator and type taskkill help command as below. That will display parameter list like /S, /U, /P, /FI, /PID, /IM, /T, /F, /? and why these are used. You will find these parameters in the commands below.

Advertisements

kill windows service command line

taskkill /?
kill windows service using taskkill windows command line
kill windows service using taskkill windows command line
Advertisements
kill process id using taskkill windows command line
kill process id using taskkill windows command line
Advertisements

First step is to identify the “Service name” of windows service stuck at stopping. Let’s say windows update service stuck at stopping, then right click on the service and click on properties will show you the service name “wuauserv”. Alterenatively, you can run powershell command “Get-Service” to get windows service details. Run the below command in command prompt to get the PID of service.

sc queryex <service name>
sc queryex wuauserv
windows service properties service  name
windows service properties service name
Advertisements
sc queryex wuauserv
sc queryex wuauserv

You can check the PID in “Task manager” under the the tab “Services”.

PID in Task manager
PID in Task manager
Advertisements

Next step is to kill windows service PID running below cmd in command prompt.

taskkill /f /pid [PID]
taskkill /f /pid 996
taskkill /f /pid
taskkill /f /pid
Advertisements

You will find the service is stopped after applying the command above. You can disable the serivce else apply the state as per your requirement.

windows update service stopped how to disable
windows update service stopped how to disable
Advertisements

You can kill processes from command prompt without knowing the PID by running the below command.

taskkill /F /FI "SERVICES eq wuauserv"
taskkill /F /FI "SERVICES eq wuauserv"
taskkill /F /FI “SERVICES eq wuauserv”
Advertisements

You can force stop a service running with particular user id using below cmd.

taskkill /F /FI "USERNAME eq Deviprasad"

cmd to task kill all windows services not respnding running as below.

taskkill /F /FI "status eq not responding"
Advertisements

You can kill services consuming more then a limit of memory usage following the command below.

taskkill /FI "memusage gt value"
taskkill /FI "memusage gt 220600"
kill pid memusage gt
kill pid memusage gt
kill service memusage gt
kill service memusage gt
Advertisements

Run the cmd as below to get list of tasks running in server.

tasklist
tasklist
tasklist
Advertisements

we can run the below cmd to kill task running in the server.

taskkill /F /IM taskmgr.exe
taskkill /F /IM taskmgr.exe
taskkill /F /IM taskmgr.exe
Advertisements

End task using powershell

We can use below powershell commands to kill windows service.

Stop-Process -ID ProcessID - Force
Stop-Process -ID 6196 - Force
Stop-Process -Name ProcessName -Force
Stop-Process -Name iexplorer -Force
kill service or pid usinf powershell
kill service or pid usinf powershell
Advertisements

powershell command to force kill services not responding.

Get-WmiObject -Class win32_service | Where-Object {$_.state -eq 'stop pending'}
Advertisements

Watch the video to get details step by step for better understanding.

Advertisements

application pools in iis overview

application pools in iis overview

As defined in Internet Information Services (IIS) an application Pool is a collection of one or more URLs that are serviced by one or a set of worker processes. After installation of SharePoint, open IIS Manager. You will notice application pools in iis.

application-pool-iis-manager-969x476

You must select an existing Application Pool or create a new pool whenever you create a service or web application in SharePoint Server.

create-new-application-pool-1314x453

application pools in iis allow multiple SharePoint websites to run on a single server without the processes or code in one site interacting with any other sites. This is primarily a security benefit, since any outside intrusion on one site is isolated. Also, problematic or poor code running on one site is isolated so that other sites on the server are unaffected. For these reasons, you should plan to use dedicated application pools to isolate authenticated content and separate applications that contain password information.

we can run powershell command to get all application pools.

Get-IISAppPool
Get-IISAppPool-754x567

we can search one or more application pool directly by running the below command.

Get-IISAppPool "DefaultAppPool","SharePoint - 37344"
Get-IISAppPool-information-875x192

Work Process in SharePoint Server 2016

Work Process list so as to get work process improvement ideas

Worker Process (w3wp.exe) handles the web requests that are sent to IIS web server  or application pool.

Name: SharePoint Administration
Service Name: SPAdminV4
Description: Performs administrative tasks for SharePoint
Path to Executable: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\BIN\WSSADMIN.EXE

Name: SharePoint Insights
Service Name: SPInsights
Description: Microsoft SharePoint Insights is a hybrid solution that helps SharePoint administrators manage their infrastructure more efficiently. After it is configured properly, it will upload data to Microsoft and give administrators access to different reports in Office 365.
Path to Executable: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\BIN\OfficeDataLoader\Microsoft.Office.BigData.DataLoader.exe
 
Name: SharePoint Search Host Controller
Service Name: SPSearchHostController
Description: Performs host deployment and management for SharePoint search components.
Path to Executable: C:\Program Files\Microsoft Office Servers\16.0\Search\HostController\hostcontrollerservice.exe

Name: SharePoint Server Search 16
Service Name: OSearch16
Description: Administers and crawls content from repositories.
Path to Executable: C:\Program Files\Microsoft Office Servers\16.0\Bin\mssearch.exe

Name: SharePoint Timer Service
Service Name: SPTimerV4
Description: Sends notifications and performs scheduled tasks for SharePoint
Path to Executable: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\BIN\OWSTIMER.EXE

Name: SharePoint Tracing Service
Service Name: SPTraceV4
Description: Manages trace output
Path to Executable: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\BIN\wsstracing.exe

Name: SharePoint User Code Host
Service Name: SPUserCodeV4
Description: Executes user code in a sandbox
Path to Executable: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\UserCode\SPUCHostService.exe
 
Name: SharePoint VSS Writer
Service Name: SPWriterV4
Description: SharePoint VSS Writer
Path to Executable: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\BIN\SPWRITER.EXE

 Name: Microsoft Project Server Calculation Service 2016
Service Name: ProjectCalcService16
Description: Microsoft Project Server Calculation Service manages the lifecycle and the communication of the processes that handle modifications to projects.
Path to Executable: C:\Program Files\Microsoft Office Servers\16.0\Bin\Microsoft.Office.Project.Server.Calculation.exe
 
Name: Microsoft Project Server Events Service 2016
Service Name: ProjectEventService16
Description: Microsoft Project Server Events Service executes events triggered by changes to entities on the ProjectServer.
Path to Executable: C:\Program Files\Microsoft Office Servers\16.0\Bin\Microsoft.Office.Project.Server.Eventing.exe
 
Name: Microsoft Project Server Queue Service 2016
Service Name: ProjectQueueService16
Description: Microsoft Project Server Queue Service executes project related jobs asynchronously. Example queue jobs: Save project, publish project, submit timesheet.
Path to Executable: C:\Program Files\Microsoft Office Servers\16.0\Bin\Microsoft.Office.Project.Server.Queuing.exe

[siteorigin_widget class=”WordAds_Sidebar_Widget”][/siteorigin_widget]
[siteorigin_widget class=”WordAds_Sidebar_Widget”][/siteorigin_widget]
[siteorigin_widget class=”SiteOrigin_Widget_Image_Widget”][/siteorigin_widget]
[siteorigin_widget class=”SiteOrigin_Widget_Image_Widget”][/siteorigin_widget]
[siteorigin_widget class=”SiteOrigin_Widget_Image_Widget”][/siteorigin_widget]
[siteorigin_widget class=”SiteOrigin_Widget_Image_Widget”][/siteorigin_widget]