如何使用jmeter中的OS Process Sampler执行在远程Windows上找到的.exe文件

时间:2019-07-14 19:03:11

标签: jmeter

我是Jmeter的新手,我需要运行一个存在于远程Windows计算机上的可执行文件,我使用了OS采样器请求,但我不知道如何使其连接到远程计算机

1 个答案:

答案 0 :(得分:0)

有2个选项:

  1. 使用PsExec,例如:

    • 命令:`cmd.exe'
    • 第一个参数:/c
    • 第二个参数:`/path/to/psexec.exe \您的远程计算机-u用户名-p密码-c /path/to/file.exe
  2. 使用Windows Powershell Remoting

    • 命令:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    • 第一个参数:$password = ConvertTo-SecureString -String ${password} -AsPlainText -Force; $credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "${username}",$password; Invoke-Command -Computer ${host} -cred $credentials -scriptBlock { /path/to/file.exe }

更多信息:How to Run External Commands and Programs Locally and Remotely from JMeter