Unable to run powershell script on all machines in network from server machine

This question already has an answer here:

  • Powershell scripts don't work by default [closed] 3 answers
  • Why are my powershell scripts not running? 7 answers

  • Remote computers need to have their execution policy changed to allow the script to run. It's the same thing you probably had to do to run the script on the host computer during testing.

    This can be accomplished via Group Policy or manually (on all of the computers).

    Using PSExec you might be able to set the policy on individual computers by running the Set-ExecutionPolicy cmdlet.


    将您的powershell行更改为绕过本地执行策略:

    powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File "C:file.ps1"
    
    链接地址: http://www.djcxy.com/p/29086.html

    上一篇: 从c#运行Powershell脚本

    下一篇: 无法在服务器计算机的网络中的所有计算机上运行PowerShell脚本