简体   繁体   English

有什么方法可以检测 Windows 服务器是在有头还是无头中运行?

[英]Is there any way to detect whether Windows server is running in headed or headless?

Is there any way to detect whether Windows 10 servers are running headed or headless mode using the command line?有什么方法可以使用命令行检测 Windows 10 服务器是在运行有头模式还是无头模式? What thing get change when the user disconnects himself from the window server?当用户与 window 服务器断开连接时,会发生什么变化?

Query session should provide whether the user disconnected from RDP or logged out from the console, but with other remote access solutions there is no universal indication. Query session应提供用户是否从 RDP 断开或从控制台注销,但对于其他远程访问解决方案,没有通用指示。

Here's an example of query session on a computer with an active console session (not headless):这是在具有活动控制台 session(非无头)的计算机上查询 session 的示例:

C:\Users\foo>query session
 SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
 services                                    0  Disc
>console           foo                       1  Active
 31c5ce94259d4...                        65536  Listen
 rdp-tcp                                 65538  Listen

and here's a counterexample of using psexec to get the output of query session from a machine with disconnected RDP users, and no one on the console session:这是使用psexec从 RDP 用户断开连接的机器上获取query session的 output 的反例,控制台上没有人 Z21D6F40CFB511982E4424E0E25ZA9:

C:\Users\administrator>psexec \\target -s query session

PsExec v2.2 - Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals - www.sysinternals.com


 SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
>services                                    0  Disc
 console                                     1  Conn
                   jsmith                    3  Disc
                   Administrator            12  Disc
 rdp-tcp                                 65536  Listen
query exited on target with error code 1.

The definition of "headless" is also somewhat fraught, since VGA does not require backwards signaling, so if a server has no monitor connected, but is logged in and outputting video - is it "headless"? “无头”的定义也有点令人担忧,因为 VGA 不需要反向信号,所以如果服务器没有连接显示器,但登录并输出视频 - 它是“无头”吗? Does it know that it is headless?它知道它是无头的吗?

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

相关问题 有没有一种方法可以检测Windows是否正在安装设备驱动程序? - Is there a way to detect whether Windows is installing a device driver? 如何检测我的软件是否在Windows XP上运行? - How do I detect whether my software is running on windows XP? PHP 脚本 - 检测是否在 linux 或 Windows 下运行? - PHP script - detect whether running under linux or Windows? 检测 ruby​​ 是否在 Windows 上运行的正确方法是什么? - What is the correct way to detect if ruby is running on Windows? 有没有办法检测 Windows 中的监视器状态(打开或关闭)? - Is there any way to detect the monitor state in Windows (on or off)? 有什么方法不能从Windows PC中检测USB? - Is there any way Not to detect USB from windows PC? electron 中是否有任何方法可以检测 Windows 上的关机? - Is there any way in electron to detect a shutdown on Windows? Cmd / PowerShell / SQL服务器:有没有办法看到Windows服务运行了多长时间? - Cmd/PowerShell/SQL server: Is there any way to see how long a windows service has been running? 检测Windows重新启动是否是由Windows更新引起的 - Detect whether a Windows reboot was due to Windows updates 在IE中使用JavaScript的Windows中可以使用任何检测URI模式的方法 - Any way to detect URI schema is available in windows using JavaScript in IE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM