Windows Server 2012 R2远程桌面访问问题

Windows Server 2012 R2 Remote Desktop access problems

我正在研究 TFS CI 构建管道。该构建包括执行功能 UI 测试(运行 功能测试)和所需的伴随准备测试代理部署步骤(部署测试代理)。

此构建过去执行成功,但最近自发停止工作。

我最初 运行 在执行挂起的 DTA 任务时遇到困难:

Task 'SetupTestMachineForUiTests' on machine '[testVM]:5985' is taking time. Please Wait

我以前在这个构建任务中遇到过这个问题,尽管是间歇性的。但是,这次无论执行多少次,该步骤都不会完成。最终(约 20 分钟),该步骤因以下错误而崩溃:

Task 'SetupTestMachineForUiTests' for machine [testVM]:5985's Error : System.Exception: Stopping test machine setup as it exceeded maximum number of reboots. If you are running test agent in interactive mode, please make sure that autologon is enabled and no legal notice is displayed on logon in test machines.

不幸的是,当步骤失败后在服务器上手动关闭 DTAExecutionHost.exe 时,DTA 任务仅将日志写入测试 VM 上的常用位置。日志没有提供关于问题可能是什么的线索。

成功执行DTA步骤的先决条件之一是在测试VM上启用了AutoLogon;我用一个简单的 PowerShell 脚本完成了这项工作,该脚本在 DTA 任务之前执行。为了确认在我的 PowerShell 脚本执行期间已正确分配测试 VM 注册表值(以启用自动登录、禁用法律声明、屏幕保护程序等),我在构建中添加了一个进一步的 PowerShell 调试脚本以将每个相关的注册表值输出到构建控制台(所有已正确分配)。

然而,当我使用测试用户名在测试虚拟机上测试远程登录时,用户凭据被接受但显示以下警告消息:

To sign in remotely, you need the right to sign in through Remote Desktop Services. By default members of the Administrators group have this right. If the group you're in does not have the right, or if the right has been removed from the Administrators group, you need to be granted the right manually.

我相信这就是问题所在。但是,到目前为止,我还没有找到解决方案。

我还考察了其他(可能,大概)相关的用户群:

几天来我一直在与这个问题作斗争;现在已经成为一个令人头疼的问题。我将非常感谢任何可能有助于找到解决方案的见解。

感谢观看。

问题是该帐户已添加到 AD 域 'DenyInteractiveLogon' 组。将帐户添加到本地 'Remote Desktop User' and/or 'Srv_SeInteractiveLogonRight' 组没有任何效果。

从域组中删除用户帐户解决了问题。