Windows Platform

Query and kill a process on a remote computer using PowerShell

Kill a process with PowerShell

Who never had the situation,  for example, one or more processes of a user must be stopped. Currently, this can be done remotely by an administrator without having to switch to the user’s computer.

Get-Process

First, we will use Get-Process cmd to list the processes that are running on the local computer.

Get-WmiObject

Also, we will use Get-WmiObject to Gets instances of Windows Management Instrumentation (WMI) classes or information about the available classes.

Situation:

However, the execution of the following script will stop “Notepad.exe” processes for audain.net user.

How to see a list of running Processes

So, we will assign the remote computer value to the variable “ComputerNameSelect”

$computerNameSelect = “audain.net”
Get-Process -computerName $ComputerNameSelect

Notepad.exe

Then, we will assign the remote process name to the variable “KillProcess”

$KillProcess = “Notepad.exe”

Stop processes with PowerShell

Get-WmiObject Win32_Process -ComputerName $ComputerNameSelect | ?{ $_.ProcessName -match $KillProcess }).Terminate()

 

Powershell Find licence key,List program,Unistall a program,Show process,Kill process