是否可以检测到特定用户在计算机上有一个打开的会话,并在该会话中打开一个进程,以便用户可以使用 PowerShell 远程处理与应用程序进行交互?
我将如何检测哪些用户在计算机上打开了会话以及他们的状态(活动、空闲、断开连接等)?我如何在其中一个会话中启动应用程序?
UPDATE
我发现您可以识别进程正在运行的会话 ID:
PS > ( Get-Process notepad ).SessionId
1
不过,当您启动进程时,我似乎找不到为该进程指定会话 ID 的方法。
Powershell 无法做到这一点,但微软(以前是 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.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)