使用PsExec远程运行powershell脚本以更改注册表中的MySQL ODBC设置

时间:2017-06-20 23:35:49

标签: powershell psexec

我正在尝试在一堆计算机上使用PsExec运行一个powershell脚本。


server:
  port: 8761
  transport: https
  name: localhost

eureka:
  instance:
    nonSecurePortEnabled: false
    securePortEnabled: true
    securePort: ${server.port}
    hostname: localhost
  client:
    registerWithEureka: false
    fetchRegistry: false
    serviceUrl:
      defaultZone: https://${eureka.instance.hostname}:${eureka.instance.securePort}/eureka/
  server:
    waitTimeInMsWhenSyncEmpty: 5

这是我得到的错误

PsExec64.exe -i \\comp-int-tst-03 -u domain\un.admin -p asdfqw /accepteula PowerShell ChangeODBCServer.ps1

这是脚本

PowerShell exited on comp-int-tst-03 with error code 1.

有没有办法让它继续下去?或者至少看看它为什么不起作用?该脚本在本地运行良好。

1 个答案:

答案 0 :(得分:0)

好的,所以试试这个,这很好。 pc-host是我试图运行它的机器。 C $是我可以作为管理员共享访问的本地磁盘。

PsExec64.exe \\comp-int-tst-03 -u crc\un.admin -p asdfqw /accepteula PowerShell -noninteractive -File \\pc-host\C$\Users\u.name\ChangeODBCServer.ps1
相关问题