0

Kill a process on multiple remote machines

kill multiple processes on multiple remote machines

get-content .\killprocess.PS1

(Get-Content 'U:\Accounts\Computers.txt') | ForEach-Object {Get-WmiObject -computer $_ -class win32_process -filter "name = 'synergy.exe'" -credential $cred| %{$_.terminate()} | out-null}

How do I add a second process to terminate into the mix?

Thanks

Community
  • 1
  • 1

1 Answers1

0

Running this locally but you can use OR to add more conditionals to your query.

For example:

Get-WmiObject -class win32_process -filter "name='chrome.exe' or name='conhost.exe'"

Hope this helps.

Cheers