如何使用命令行诊断 RDP?

Fla*_*ape 3 windows rdp configuration serial windows-command-prompt

我有一台带有 1and1 的服务器,他们已经放弃尝试恢复 RDP 访问(根本没有尝试)并告诉我重新映像服务器。由于这是一台生产机器,我想避免这种情况,因为它会涉及缓慢的 FTP 恢复,而且我不确定它是否真的能解决问题。

机器重新启动,失去了与现有凭据的RDP 连接。我按照以下说明设法以管理员身份访问远程服务器上的命令提示符:http ://help.1and1.com/servers-c37684/windows-server-c39510/system-recovery-c76208/resolving-a -failed-connection-to-remote-desktop-a627381.html

现在,我已经终止了防火墙和 ipsec 进程。仍然没有骰子。我可以用 CMD.exe 做什么

1)诊断情况(是windows还是网络问题)

2) 可能补救RDP连接的丢失

服务器详情:

  • 视窗服务器 2012
  • 站点正在运行(IIS/W3P 很好)
  • 终端服务正在运行
  • 防火墙已禁用
  • ipsec 已禁用
  • 没有网络防火墙(暂时在主机控制面板中禁用)
  • 可以从当前位置ping通(重启前工作正常)
  • 不确定内部特定于域的网络设置...

更新:

添加了注册表值以确保启用远程连接:http : //expertpandas.com/blog/index.php/enabledisable-rdp-using-command-prompt-for-windows-2012/

还发现了这一点: 但我不确定如何使用 CMD 设置启动策略... http://www.techrepublic.com/forums/questions/remote-desktop-does-not-connect-after-a-restart /

Mit*_*tch 8

我首先检查 RDP 是否在监听:

netstat /p tcp /a | findstr 3389
Run Code Online (Sandbox Code Playgroud)

如果你没有看到

TCP    0.0.0.0:3389           hostname:0                LISTENING
Run Code Online (Sandbox Code Playgroud)

存在阻止远程会话的问题。特别看看HKLM\System\CurrentControlSet\Control\Terminal Server\fDenyTSConnections哪个决定是否启用了 RDP。

# using powershell
if ((Get-ItemProperty "hklm:\System\CurrentControlSet\Control\Terminal Server").fDenyTSConnections -eq 0) { write-host "RDP is Enabled" } else { write-host "RDP is NOT enabled" }
Run Code Online (Sandbox Code Playgroud)

您还可以使用Get-EventLog命令行开关搜索事件日志:

# using powershell
Get-EventLog application -EntryType Error -After (Get-Date).AddDays(-1)
Get-EventLog system -EntryType Error -After (Get-Date).AddDays(-1)
Run Code Online (Sandbox Code Playgroud)