我有一个调用 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.
问题在于行 请输入 MYDOMAIN\myuser 的运行密码:
通常我可以输入登录用户的密码,但使用远程电源 shell session 时,这种情况永远不会发生。
最佳答案
关于powershell - 不等待用户输入的远程 powershell 和提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24036771/