remote desktop services

The Case of Remote Desktop Services Random Disconnections

If you are running Windows Server 2008 R2 servers and you find yourself randomly being disconnected from RDS (Remote Desktop Services) sessions on your servers, or sometimes find your servers completely inaccessible you could be impacted by an issue as a result of servicing order (AKA, the order in which you install Windows Updates). The issue effects servers running Windows Server 2008 R2 with Service Pack 1 and with KB2667402 (Update for Terminal Service Denial of Service Vulnerability).

This is something I thought I had written about already as it effected us in a big way at work due to the way in which our virtual machine images were compiled but it seems actually, I hadn’t.

In Windows Server 2008 R2 RTM, the file version of the rdpcorekmts.dll file in Windows Server 2008 R2 RTM is 6.1.7600.16952. In Windows Server 2008 R2 with Service Pack 1, the file version of the rdpcorekmts.dll file is 6.1.7601.17767 and the file version of the rdpcorekmts.dll file after installing KB2667402 is 6.1.7601.17828.

If as a result of servicing order, you installed the KB2667402 update prior to installing Windows Server 2008 R2 Service Pack 1, the file version of rdpcorekmts.dll is downgraded from the KB2667402 version number to the SP1 version number and the hotfix is in essence removed. This causes the Remote Desktop Services service to fail and terminate itself repeatedly as the service believes that there is an attempt to modify it’s files occurring and as a failsafe, shuts down remote access.

In order to resolve the issue, Microsoft re-released KB2667402 as KB2667402v2 which allows you to re-install the update after an installation of Service Pack 1 to bring the file version back up to 6.1.7601.17828 and to allow the Remote Desktop Services service to work again as normal. Trying to re-install the original release of KB2667402 will result in a message that the update is already installed and does not apply to this computer.

You can download the version 2 release of the update from the Microsoft Download Center at http://www.microsoft.com/en-us/download/details.aspx?id=29169. The update is 327KB and requests a reboot, however you can install the update and delay the restart by simply manually restarting the Remote Desktop Services service. You should still restart the server at some point in time though as the pending reboot will block operations such as installation of roles and features.

Media Center Auto-Start on Windows 8

With my backend server update to Windows Server 2012, I was keen to get my media front-end up to Windows 8 also to take advantage of SMB 3.0 for improved performance of opening and accessing the media stored on the server. I rebuilt the front-end about two weeks ago, taking advantage of the free Media Pack upgrade prior January 31st. I had already tested the components I use to make my media center tick including Shark007 Codec Pack, MyMovies and MediaControl so I knew all was good.

After installing Windows, the software needed and configuring auto-login for the media center service account, I proceeded to copy the shortcut I used in Windows 7 to launch the Media Center application into the Startup start menu group for the account. In Windows 8, the Startup group can be found in %AppData%MicrosoftWindowsStart MenuProgrmsStart-Up. With the shortcut added, I restarted the machine to test the result.

In Windows 8, to help attract people to the new Start Screen, the Start Screen automatically opens at login of any account. What I found was that this screen would pop over the Windows Media Center application which is hardly seamless for a keyboard and mouse free front-end. Using the remote, I clicked the Desktop tile on the Start Screen and Media Center appeared as expected, but I couldn’t control it. The reason was that although the application was now visible, it didn’t have focus so any inputs were ignored. Attaching a mouse to the machine and clicking anywhere in the Media Center interface restored focus but short of writing an AutoIt macro to do that for me (which is a nasty hack) this isn’t what I wanted or needed.

Luckily, a colleague pointed me in the direction of a Group Policy setting used sometimes in Remote Desktop Services or kiosk computer scenarios where the Explorer interface is hidden and a default application launched in it’s place. The setting still existed in Windows 8, so I gave it a shot and guess what? It works perfectly. I’m in the fortunate position that I am using Windows Server 2012 Essentials in a domain scenario so I was able to apply the Group Policy from the server, however this fix will work equally well for a non-domain scenario.

The policy setting can be found under User Settings > Administrative Templates > System. The setting is named Custom User Interface.

Enable the setting and specify the name of the application you want to launch. In my case, it is %WinDir%eHomeeShell.exe /nostartupanimation /mediamode.

It’s highly recommended to use environment variables here and not local paths if you can as I have done above. This will also work for Windows XP, Vista and 7 along with working for XBMC, Plex and other media clients you may use besides Windows Media Center. The byproduct of this is that startup performance is actually improved as you are no longer waiting for the Explorer shell interface to launch, and it prevents a few processes from running on the machine, giving you a little more CPU and Memory available.

As you will see, I use a couple of switches with my Windows Media Center startup to control the behaviour of it, which I would also recommend. These two switches stop the animation of the Media Center logo upon startup which I find saves about a second in load times and the second enters Media Mode. In this mode, Media Center’s close and minimize buttons are disabled causing Media Center to always run full screen and cannot be closed unless you use the manual Exit Media Mode option in the menu.

In the next couple of days, I’ll try and get a YouTube video up demonstrating the process for configuring this setting both via Windows Server 2012 Essentials domain and locally using the Local Group Policy Editor.