【问题标题】:How to run processes with Invoke-WMIMethod on remote computer in foreground如何在前台远程计算机上使用 Invoke-WMIMethod 运行进程
【发布时间】:2013-01-08 12:08:50
【问题描述】:

我正在运行这个命令

Invoke-WmiMethod -ComputerName $machine -Credential $cred -Impersonation 3 -Path Win32_process -Name create -ArgumentList "powershell.exe -ExecutionPolicy Unrestricted -File C:\Windows_Updates.ps1" -Verbose

唯一的问题在于远程机器,它被创建为后台进程。当我打开任务管理器时,我可以看到 powershell.exe,但我无法确定发生了什么。我几乎到处都看过,但找不到解决方案。

基本上我需要远程执行powershell文件。我愿意使用其他可以看到脚本正在运行的解决方案。

【问题讨论】:

    标签: windows wmi powershell-2.0


    【解决方案1】:

    【讨论】:

    • 是的,我知道 psexec。正在寻找原生的 powershell 解决方案。
    • 我猜是一个 WMI 解决方案。 This other article说微软在2000sp3之后禁用远程交互过程。本文有一个使用任务调度器的例子,比如technet博客windowsitpro.com/article/vbscript/…
    猜你喜欢
    • 1970-01-01
    • 2013-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多