远程PowerShell和不等待用户输入的提示

时间:2014-06-04 11:56:30

标签: powershell remote-access

我有调用schtasks.exe的脚本来导入导出的xml任务。当脚本直接在服务器上执行时,Schtasks.exe会提示输入用户密码。

当我使用远程powershell调用相同的脚本时,我会这样:

[remote_server]: .\install.ps1
SUCCESS: The scheduled task "monitor.ps1" has been terminated successfully.
SUCCESS: The scheduled task "monitor.ps1" was successfully deleted.
Please enter the run as password for MYDOMAIN\myuser:
schtasks.exe : ERROR: The system cannot find the file specified.

问题是行Please enter the run as password for MYDOMAIN\myuser:通常我可以为登录用户输入密码,但是远程电源shell会话通常不会发生这种情况。

1 个答案:

答案 0 :(得分:2)