We can use filter option (/FI) to specify the image name. The syntax is as given below.
taskkill /s remoteServer /u userName /FI “IMAGENAME eq filename”
For example, if I need to kill all command window processes, I would run the below command.
taskkill /s 10.132.79.23 /u administrator /FI “IMAGENAME eq CMD.EXE”
If you need to kill outlook process, the command would be:
taskkill /s 10.132.79.23 /u administrator /FI “IMAGENAME eq OUTLOOK.EXE”
Kill processes executed by a particular user
The command is similar to the previous case with one change. Instead of ‘imagename‘, now we use ‘username‘ in the filter argument.
taskkill /s remoteServer /u userName /FI “USERNAME eq userLoginId”
Viewing the list of processes on remote computer
We can get the remote processes list using tasklist command.
To get list of all the processes, the command is :
tasklist /s remoteServer /u userName
To list the processes running a particular image file:
TASKlist /S remoteServer /u userName /FI “IMAGENAME eq filename”