简体   繁体   English

VMWare PowerCLI调用VMScript

[英]VMWare PowerCLI Invoke-VMScript

I would like to Invoke a command on a Remote VM using PowerShell with PowerCLI. 我想使用带有PowerCLI的PowerShell在远程VM上调用命令。

Invoke-VMScript -ScriptText "cmd /c calc" -ScriptType Bat -VM $VMName -GuestCredential $Credential -Confirm:$false -ea SilentlyContinue

Sadly everytime when my command get's invoked an Popup appears telling me "A Program running on this computer is trying to display a message" If click manually on that Popup my Script runs fine, but how can I automate this, so that I can use PowerCLI for this. 可悲的是,每次我的命令get被调用时,都会出现一个弹出窗口,告诉我“此计算机上运行的程序试图显示一条消息”。如果在该弹出窗口上手动单击,我的脚本运行良好,但是如何使它自动化,以便可以使用PowerCLI为了这。

The goal is to execute a Binary in Interactive Mode, that processes Automated Tasks, when the Script get's invoked by "Invoke-VMScript" 目标是在“ Invoke-VMScript”调用脚本时以交互模式执行二进制文件,该二进制文件处理自动化任务

This is an issue with Interactive Services Detection . 这是交互式服务检测的问题。 Your script is trying to run as interactive in Session 0. 您的脚本试图在会话0中以交互方式运行。

The standard workarounds are creating a schedule task and then triggering it. 标准的解决方法是创建计划任务,然后触发它。 Or invoking psexec.exe to the user session with -i . 或使用-ipsexec.exe调用到用户会话中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM