You snippet does not work because you are first actaully getting process on the remote computer and piping them to stop-process in local computer. Instead use invoke-command as @Olaf

Invoke-Command -ComputerName AD-DC01 -ScriptBlock {Get-Process -Name 'conhost', 'PowerShell' | Stop-Process}

you might have to use the -Authentication Kerberos option to gain rights to the remote computer. Also you can use psexec along with taskkill.

Answer from avarice on Stack Overflow
🌐
Reddit
reddit.com › r/powershell › remote kill processes with powershell
r/PowerShell on Reddit: Remote kill processes with PowerShell
February 27, 2017 - If you sent me that when I was learning the ropes I would have no idea what you were getting at. Use the KISS methodology. Keep it simple, stupid. Invoke-command -computername "hostname" {stop-process -name "process name"}. ... IIRC, Invoke-Command ...
Discussions

How-to kill process remotely - IT & Tech Careers - Spiceworks Community
Time for a System’s Administrator trick that I’ve found to be extremely useful over the years. Sometimes you’ve got a program that’s stuck on a machine in an office many miles away and you just need to kill the process to fix the issue. If all your machines are connected, most of the ... More on community.spiceworks.com
🌐 community.spiceworks.com
16
December 20, 2018
powershell - Kill a process on multiple remote machines - Stack Overflow
I am looking as the title says to kill a process (for example name.exe) on multiple remote machines. I can do it individually using pskill or taskkill using (for example): pskill -t \ -u -p name.... More on stackoverflow.com
🌐 stackoverflow.com
Kill Process on Remote Machine
I have a script I’m working on that asks for a machine name, and then produces a list of running processes on that machine. From there it asks the user I they want to kill a process on that machine. If they select Yes, it prompts the user to type in the name of the process and is supposed ... More on forums.powershell.org
🌐 forums.powershell.org
0
0
April 16, 2015
wmi - Try to remotely kill a process using PowerShell - Stack Overflow
I have followed the advice here and here to write a PowerShell script that remotely kills a process: Get-WmiObject Win32_Process -Filter "Name='myapp.exe'" -ComputerName remotecomputername | Invoke-WmiMethod -Name Terminate · The above works when I execute it on my machine, but when it's run ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
PowerShell Forums
forums.powershell.org › powershell help
Kill process of a different user remotely - PowerShell Help - PowerShell Forums
August 25, 2016 - Hi there, I’m just learning the ... I need to kill a specific task that is run on a remote computer by all users that are not currently logged in. I want to be able to run the command on a Windows 7 machine. What I got so far: Get-WmiObject win32_process -computername AAA ...
🌐
Medium
medium.com › @dimitrikoens › kill-a-process-remotely-3b2f09167299
Kill a process remotely. With PowerShell you can kill a process… | by Dimitri Koens | Medium
November 11, 2023 - Function Stop-ProcessRemote { param( [string[]]$ComputerName = $Env:COMPUTERNAME, [Parameter(Mandatory=$true)] [string]$ProcessName ) $p = Get-WmiObject Win32_Process -ComputerName $ComputerName | Where-Object { $_.name -eq $ProcessName } $p.Terminate() } This article has been previously published on my — now defunct — WordPress blog.
🌐
Server Fault
serverfault.com › questions › 1022059 › how-can-i-kill-a-process-remotely-on-a-windows-server-when-the-server-has-exceed
powershell - How can I kill a process remotely on a windows server when the server has exceeded its memory limit? - Server Fault
June 18, 2020 - With products like SCCM or SCOM running, you can still pass commands through those agents. Another option that worked was using the PowerShell Get-WmiObject Terminate() method on the Win32_Process class to kill a remote process.
🌐
4sysops
4sysops.com › home › blog › tips › query and kill a process on a remote computer using powershell and wmi
Query and kill a process on a remote computer using PowerShell and WMI – 4sysops
February 21, 2017 - This tutorial discusses a few PowerShell scripts that allow you to query and kill a process on a remote computer using WMI (Windows Management Instrumentation).
🌐
Spiceworks
community.spiceworks.com › it & tech careers
How-to kill process remotely - IT & Tech Careers - Spiceworks Community
December 20, 2018 - Time for a System’s Administrator trick that I’ve found to be extremely useful over the years. Sometimes you’ve got a program that’s stuck on a machine in an office many miles away and you just need to kill the process to fix the issue. If all your machines are connected, most of the time you can do that through WMI procedures.
Top answer
1 of 2
4

There are several approaches you can take to remote kill processes from a CLI:


Powershell

Assuming you have an account with the requisite permissions, and have configured Powershell for remote use (not covered in this answer, but here's a free e-book from Don Jones covering how to get set up,) you can use one of several Cmdlets to remotely kill processes.

Stop-Process via Invoke-Command

You should be able to use Stop-Process along with an Invoke-Command (or by opening a more permanent remote session).

Invoke-Command -ComputerName RemoteComputer -ScriptBlock {Stop-Process processname}

This would be my preference, but requires some configuration in advance, so is not ideal in every situation.


Built-in Solutions

Taskkill.exe

Taskkill is provided on recent Windows machines, and can be used remotely with the /s parameter.

Example:

taskkill /s remotecomputer /pid processID

Sysinternals Tools

You can also use either of PSKill or PSExec (available at live.sysinternals.com) to terminate processes.

PSKill

Similar to Taskkill, but not provided on Windows machines by default.

Example:

pskill \\remotecomputer <process ID | name>

PSExec

Using PSExec, on the other hand, you can run any command you would normally use to manage processes locally.

Example:

psexec \\remotecomputer taskkill /pid processID
2 of 2
2

You can run this command from cmd or the start menu:

taskkill /f /im name.exe 

This also has a /S parameter to allow you to set the system to connect to. So you will be able to:

taskkill /s remoteserver /f /im name.exe

To find name.exe,

tasklist

will give you a chart with all the processes, the names, the executable (name.exe) and the PID [process ID].

Find elsewhere
🌐
Adam the Automator
adamtheautomator.com › how-to-kill-a-windows-process
How to Kill a Windows Process on a Remote System
January 28, 2024 - PowerShell gives you a couple of options for killing remote processes; the first cmdlet Stop-Process cannot natively kill a remote process, as it does not have an option to specify a computer name.
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › module › microsoft.powershell.management › stop-process
Stop-Process (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
The Stop-Process cmdlet stops one or more running processes. You can specify a process by process name or process ID (PID), or pass a process object to Stop-Process. Stop-Process works only on processes running on the local computer.
🌐
AnyViewer
anyviewer.com › how-to articles › 2 top ways to kill process on remote computer using powershell
2 Top Ways to Kill Process on Remote Computer Using Powershell
December 13, 2024 - Step 4. You’ll be asked to enter the credentials of the remote PC. Once it is accomplished, the remote connection is successful. In this part, We’ll show you some PowerShell scripts to kill a process if it is running on a remote PC.
🌐
Techibee
techibee.com › powershell › easy-way-to-kill-processes-on-remote-computer-using-powershell › 811
Easy way to kill processes on remote computer using powershell
October 1, 2010 - Say if the computers are in a text file called comps.txt, the script follows like this. ... In this example I am killing notepad process. You can replace the name with process you want to kill on remote computer.
🌐
SharePoint Diary
sharepointdiary.com › sharepoint diary › powershell › how to kill a process in powershell with stop-process?
How to Kill a Process in PowerShell with Stop-Process? - SharePoint Diary
October 22, 2025 - You can stop multiple processes by their name as: ... Stop-Process works only on the local computer by default. You can use the Invoke-Command cmdlet in PowerShell if you need to terminate a process running on a remote computer.
🌐
Rakhesh
rakhesh.com › powershell › killing-a-process-on-a-remote-computer-using-powershell
Killing a process on a remote computer using PowerShell – rakhesh.com
September 18, 2013 - The stop-process cmdlet doesn’t support the -ComputerName switch, so the second method doesn’t even work remotely. The third method fails with an error Stop-Process : Feature is not supported for remote machines and the first method fails with an error Exception calling "Kill" with "0" argument(s): "Feature is not supported for remote machines.".
🌐
ByteInTheSky
byteinthesky.com › home › powershell › how to kill process on remote computer
How to Kill Process on Remote Computer Using PowerShell - ByteInTheSky
March 24, 2023 - To kill process on remote computer, we can create session to remote computer using Enter-PSSession. Then, we can use Stop-Process cmdlet to kill the process. Lastly, to close the session we can use Exit-PSSession cmdlet.
🌐
PowerShell Forums
forums.powershell.org › powershell help
Kill Process on Remote Machine - PowerShell Help - PowerShell Forums
April 16, 2015 - I have a script I’m working on that asks for a machine name, and then produces a list of running processes on that machine. From there it asks the user I they want to kill a process on that machine. If they select Yes, it prompts the user to type in the name of the process and is supposed ...
🌐
Windows Command Line
windows-commandline.com › kill-remote-process
How to view and kill processes on remote computer?
September 20, 2016 - Windows Commands, Batch files, Command prompt and PowerShell · on June 6, 2012 · by Srini · In Windows, we can kill processes running on a remote computer using the taskkill command. We can specify process id/image file name/user name to identify the processes that need to be killed.
🌐
Stack Overflow
stackoverflow.com › questions › 46813267 › try-to-remotely-kill-a-process-using-powershell
wmi - Try to remotely kill a process using PowerShell - Stack Overflow
I have followed the advice here and here to write a PowerShell script that remotely kills a process: Get-WmiObject Win32_Process -Filter "Name='myapp.exe'" -ComputerName remotecomputername | Invoke-WmiMethod -Name Terminate · The above works when I execute it on my machine, but when it's run ...
🌐
PowerShell Forums
forums.powershell.org › powershell help
Stop remote process with Get-WmiOjbect - PowerShell Help - PowerShell Forums
November 7, 2014 - Hi all. I’ve only been technically working in IT as a sysadmin for less than 1 year. young with very VERY little knowledge about scripting and everything for that matter. I am trying to kill processes on a number of servers that display an error from time to time saying that an instance of ...