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

start stop manage services in windows server with powershell

This post is all about how to start stop manage services in windows server with powershell. We will discuss the start service powershell command, stop service powershell command, Killing Windows Service that Hangs on Stopping or Not Responding command, how to get service powershell command, how to set service startup type powershell command.

Get Service powershell command windows server

This command will display all service on computer. Default display will be status, service name, and display name each service

Get-Service
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Get service begin with search string

Get service begin with Display services that include search string “sp”

Get-Service "sp*" | Sort-Object status
Get service begin with Display services that include search
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Display services that include search string

Display services that include search string “sharepoint”

Get-Service -Displayname "*sharepoint*"
Display services that include search string
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Get services begin with search string and an exclusion

Get services begin with search string “sp” and an exclusion “spo”

Get-Service -Name "sp*" -Exclude "spooler","sppsvc"
Get services begin with search string and an exclusion
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Get object details for service

Get-Service SPAdminV4 | Select-Object *
Get service begin with Display services that include search
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Display services that are running

Display services with status Running

Get-Service | Where-Object {$_.Status -eq "Running"}
Display services that are running
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Display services that are Stopped

Display services with status “Stopped”

Get-Service | Where-Object {$_.Status -eq "Stopped"}
Display services stopped
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Start Service powershell command

Below command returns how to start a particular service using powershell.

Start-Service ServiceName
example: ServiceName = SPAdminV4
Start-Service SPAdminV4

Stop Service powershell command

Below command returns how to stop a particular service using powershell.

Stop-Service ServiceName
example: ServiceName = OSearch16
Stop-Service OSearch16
how to stop a particular service using powershell
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Disable Service powershell command

Below command returns how to disable a particular service using powershell.

Set-Service ServiceName -StartupType Disabled
or
Set-Service -Name ServiceName -StartupType Disabled
example: ServiceName = OSearch16
Set-Service -Name OSearch16 -StartupType Disabled
how to disable a particular service using powershell
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});

Start Service with status stopped

Start service whose status is stopped bu running below command.

Get-Service Wsearch | Where {$_.status –eq 'Stopped'} | Start-Service

stop start disable particular windows services with status stopped running stopping using powershell

https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8844016778182294 (adsbygoogle = window.adsbygoogle || []).push({});