Gre*_*oud 3 windows firewall remote windows-firewall
情况:
使用 Windows 防火墙运行 PsExec 需要 20 秒,禁用它需要 1 秒。
添加到防火墙的例外:
根据http://jamesrayanderson.blogspot.co.uk/2010/04/psexec-and-ports.html打开端口 135 和 445(都是 tcp)
“允许应用程序通过防火墙”选择“远程服务管理”
确保网络设置为私有
没有这两个它根本不会连接。运行 Windows 10 的目标机器
在 20 秒等待期间,它说“正在启动 PsEXESVC”
好的,一个小小的wireshark告诉我们,我们还需要打开另一个被请求的端口。
我第一次运行它是 49669 第二次它是 49670
不知道为什么,也不知道它会接受什么范围,有什么想法吗?
显然,这是启用“远程服务管理”时组策略客户端的问题。
解决方法是运行以下命令:
netsh advfirewall firewall set rule name="Remote Service Management (RPC)" profile=domain new enable=yes
我使用 PsExec(运行缓慢)批量远程执行此操作,如下所示,给定受影响的工作站,每行一个计算机名称,在工作站.txt 中:
for /f %i in (workstations.txt) do @start /B psexec \\%i netsh advfirewall firewall set rule name="Remote Service Management (RPC)" profile=domain new enable=yes
这样做psexec @workstations.txt
(而不是使用 for 循环)仍然会以 20 秒的延迟缓慢地串行运行命令。使用合理数量的工作站,上述命令将并行启动它们。当然还有其他方法可以远程运行命令,但这对我来说效果很好。
资料来源:https : //harryjohnston.wordpress.com/2009/12/18/delays-when-connecting-to-windows-7-clients-for-remote-administration/