杀死多台远程机器上的进程 [英] Kill a process on multiple remote machines

查看:59
本文介绍了杀死多台远程机器上的进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找标题所说的杀死多个远程机器上的进程(例如 name.exe).我可以使用 pskill 或 taskkill 单独使用(例如):pskill -t \ -u -p 名称.exe但这在 50 多台机器上变得不切实际.

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.exe but this becomes impractical with 50+ machines.

有没有办法让它像 psexec 那样使用@C:\name.txt 或在 powershell 或类似的东西中读取 IP 地址的文本文件?

Is there a way to make it read a text file of IP Addresses like psexec does using the @C:\name.txt or in powershell or something similar?

所有设备都在同一个域中.预先感谢您的帮助.

All devices are on the same domain. Thank you in advance for your help.

推荐答案

如果您有一个包含机器列表的文本文件,您可以使用以下方法轻松完成:

If you have a text file with a list of machines you could do it trivially with:

get-content serverlist.txt | Foreach-object {& pskill -t \\$_ -u -p name.exe}

这篇关于杀死多台远程机器上的进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆