我正在尝试在一系列机器上运行 netmon,我能够启动 netmon,这似乎很好。但是,当我发出 aStop-Job *
时,似乎 netmon 没有正确关闭,这导致数据包捕获无用。Netmon 期待 "ctrl + C" ,当我停止工作时有没有办法发出这个?当使用 /keypress 选项时,Netmon 可以使用 /stop 使用其他键序列
$server = get-content C:\Server.txt
$capturedevice = "CAPTUREMACHINE"
foreach ($server in $server)
{ $scriptBlockContent = { param ($servername)
Nmcap /capture /network * /file C:\temp\"$servername".chn:400MB }
Invoke-Command -ComputerName $server -Scriptblock $scriptBlockContent -ArgumentList $server -AsJob }
foreach ($capturedevice in $capturedevice){ $scriptBlockContent =
{ param ($capturedevicename) Nmcap /capture /network * /file D:\temp\"$capturedevicename".chn:400MB }
Invoke-Command -ComputerName $capturedevice -Scriptblock $scriptBlockContent -ArgumentList $capturedevice -AsJob }