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

标签 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.

问题在于行 请输入 MYDOMAIN\myuser 的运行密码: 通常我可以输入登录用户的密码,但使用远程电源 shell session 时,这种情况永远不会发生。

最佳答案

关于powershell - 不等待用户输入的远程 powershell 和提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24036771/

相关文章:

linux - 在带有屏幕和 nohup 的 Linux 机器上远程运行脚本在注销后不久被终止

c++ - linux:如何断开远程用户访问?

php - 远程 SQLite 管理器

windows - "Remote machine is AAD"但 "The logon attempt failed"

string - PowerShell用日期和时间替换两个字符串之间的文本

Powershell 哈希表计数和键属性重载

powershell - 如何使用变量的值作为转换类型?

json - smartsheet api更新行错误1004。您无权

powershell - Azure Devops发布管道中的参数 block 问题

remote-access - 在Centos或RH类型的Linux上启动vncserver失败,并显示-致命服务器错误: could not open default font 'fixed' .如何解决此问题?