简体   繁体   English

查看 Azure 虚拟机上的当前用户会话

[英]View current user sessions on Azure virtual machines

Before we start using Azure's virtual machines we're interested if there's a similar mechanism to qwinsta command that can be used to retrieve current user sessions from virtual machines and also like qwinsta returns us information about which ones are free.在我们开始使用 Azure 的虚拟机之前,我们感兴趣的是是否有与 qwinsta 命令类似的机制,可用于从虚拟机检索当前用户会话,并且还像 qwinsta 返回我们有关哪些是免费的信息。 I've had a Google but haven't found anything, can someone please point me in to the right direction with this?我有一个谷歌,但没有找到任何东西,有人可以指出我正确的方向吗? What is the right approach to achieve this?实现这一目标的正确方法是什么? Cheers.干杯。

This is a result from an Azure VM running Windows Server 2012:这是运行 Windows Server 2012 的 Azure VM 的结果:

PS D:\Users\***> query session
 SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
 services                                    0  Disc
 console                                     1  Conn
>rdp-tcp#1         ***                       2  Active
 rdp-tcp                                 65536  Listen

(Usrename was removed for security reasons) (出于安全原因删除了用户重命名)

You can also enable remote PowerShell on the Azure VM and remotely execute PowerShell script.您还可以在 Azure VM 上启用远程 PowerShell并远程执行 PowerShell 脚本。

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

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