Powershell:将psexec与UNC路径一起使用会给出;“访问被拒绝”;

Powershell:将psexec与UNC路径一起使用会给出;“访问被拒绝”;,powershell,remote-access,psexec,Powershell,Remote Access,Psexec,我正在尝试运行以下powershell命令: psexec\\MachineB“\\MachineB\drops\Func2WebSiteOnline.bat” 我得到这个错误: PsExec无法在上启动\\MachineB\drops\Func2WebSiteOnline.bat MachineB:访问被拒绝 我试过以下几件事: 在“管理员”模式下运行powershell 使用“-u Domain\user-p password”参数运行powershell命令 这些都没有帮助。但是,我可以对

我正在尝试运行以下powershell命令:

psexec\\MachineB“\\MachineB\drops\Func2WebSiteOnline.bat”

我得到这个错误:

PsExec无法在上启动\\MachineB\drops\Func2WebSiteOnline.bat MachineB:访问被拒绝

我试过以下几件事:

  • 在“管理员”模式下运行powershell
  • 使用“-u Domain\user-p password”参数运行powershell命令
  • 这些都没有帮助。但是,我可以对machineB运行以下简单命令:

    psexec\\MachineB网络停止数据缓存

    这很好用

    关于如何针对MachineB运行上面的批处理文件,有什么想法吗


    谢谢

    我找到了一个有点非传统的方法来解决这个问题

    psexec\\MachineB-u域\用户-p密码cmd/c“cd/d I:\drops\Func2&&func2web.bat”