【问题标题】:Start a program in active user session with PowerShell remoting使用 PowerShell 远程处理在活动用户会话中启动程序
【发布时间】:2009-11-13 08:11:10
【问题描述】:

是否可以检测到特定用户在计算机上打开了会话并在该会话中打开一个进程,以便用户可以使用 PowerShell 远程处理与应用程序进行交互?

我将如何检测哪些用户在机器上打开了会话以及他们的状态是什么(活动、空闲、断开连接等...)?我将如何在其中一个会话中启动应用程序?

更新
我发现您可以识别进程正在运行的会话 ID:

PS > ( Get-Process notepad ).SessionId
1

不过,当您启动进程时,我似乎无法找到指定进程的会话 ID。

【问题讨论】:

    标签: .net powershell remoting


    【解决方案1】:

    Powershell 无法做到这一点,但 microsoft(以前是 sysinternal 的)工具 PSEXEC 可以做到这一点。看一下-i参数:

     -i         Run the program so that it interacts with the desktop of the
                specified session on the remote system. If no session is
                specified the process runs in the console session.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-31
      • 2014-10-02
      • 1970-01-01
      • 1970-01-01
      • 2013-11-29
      • 1970-01-01
      相关资源
      最近更新 更多