Clearing Hung/Disconnected Sessions Without Rebooting Windows Server 2012 R2

For this situation the setup consisted of four Windows Server 2012 R2 servers running Citrix XenApp 7.15. They host a desktop as well as several published applications.

Recently I had multiple users with disconnected sessions that just would not log off. I suspect the server was running into resourcing issues as there was a high number of sessions on there previously. As a result, these hung sessions meant that they could no longer launch the hosted shred desktop or any of the published applications. The usual course of action in this case is to reboot the server when appropriate however these users needed access sooner rather than later and I couldn’t reboot whilst other users are logged on to those same production servers.

I worked out a way around this and documented the steps below.

These are the offending sessions (below). The same processes hung within each one. Winlogon.exe appears to be the culprit. Attempting to end these via task manager doesn’t work and with taskkill results in – This is critical system process. Taskkill cannot end this process.

Log on to the affected XenApp server and run qwinsta from an elevated command prompt to find the session ID of the disconnected sessions (disc state). Note no username against the session.

Run query process /ID:[session_id] to get the PID of the hung winlogon.exe process within that session.

At this point I tried taskkill /f /t however this didn’t work.

Switching to powershell and using kill –id [PID] does the job effectively.

You can see that there are no longer any process running within that session.

I did this for all disconnected sessions.

I attempted a logoff however the sessions no longer exist, the entries in task manager must just be blank placeholders for the old sessions.

I closed and reopened task manager to confirm and sure enough the sessions disappeared.

I checked in with the users and there were able to launch published applications successfully again.

Hopefully someone finds this useful. Any comments welcome.


Avast Administration Console – Can’t Connect to Server

I recently came across an issue where the Avast Administration Web Console wouldn’t open. The error stated that it couldn’t connect to the server. Clicking the reload button made no difference.

As you can see from the screenshot it said to check that the avast! Administration Console service was running so I did and surprise surprise it wasn’t.

Starting the service was unsuccessful – it’s never that easy. I received an error stating that the service had started and stopped immediately and that some services are set to stop automatically if they’re not in use. At this point I thought it best to check the event logs.

Service cannot be started. System.Data.EntityCommandExecutionException: An error occurred while reading from the store provider’s data reader. See the inner exception for details. —> System.Data.SqlServerCe.SqlCeException: The database file is larger than the configured maximum database size. This setting takes effect on the first concurrent database connection only. [ Required Max Database Size (in MB; 0 if unknown) = 2049 ]

So we can see here that the service isn’t starting due to an issue connecting to the database. The highlighted text indicates what the problem was. I did some digging and found that the connection string sits within a file called Avast.Sbc.Service.cfg under the following directory.

I decided to modify the Max Database Size parameter to see if this would resolve the issue. I changed it to 4091 (I had tried slightly higher however it seems 4091 is the maximum).

I saved the changes (you need to run notepad as administrator to modify this) and then I tried starting the service again.

Success! Hopefully someone finds this helpful. I’m not sure if this is a permanent fix however it’s up and running for now.

Backups Failing on Small Business Server 2011

You may have noticed your backups have suddenly stopped working (VSS Error 0x800423F3 – Event ID 8230). It’s possible that this started occurring following the Microsoft SharePoint Foundation 2010 Service Pack 1 (SP1) update. If this is the case then you need to complete the update process by updating the SharePoint databases.

In order to update the SharePoint databases, you must manually run the PSconfig utility:

  1. Open an Administrative command prompt.
  2. Change directory to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
  3. Run PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

For more information on this issue check out this article on TechNet.

SBS 2008 RWW Remote Desktop Issue for Windows 10 Clients

When you attempt to connect to a computer using Remote Desktop via SBS 2008 Remote Web Workplace you may receive an error like this: The wizard cannot configure Remote Desktop Connection settings. Make sure that the client version of Remote Desktop Protocol (RDP) 6.0 or later is installed on this computer.

To resolve this issue we need remove the RDP version check. On the Small Business Server browse to “C:\Program Files\Windows Small Business Server\Bin\webapp\Remote”. There will be a file named tsweb.aspx. Edit the file and look through it for a section that looks this:

Sub window_onload()
Dim targetMachineName
Dim version
On Error Resume Next
version = MsRdpClient.Version
if Err then
msgbox ControlLoadFailed_ErrorMessage,0,RemoteDesktopCaption_ErrorMessage
exit sub
end if
On Error GoTo 0
if strcomp(version,”6.0.6000″) < 0 then
msgbox IncorrectClientVersion_ErrorMessage, 0, RemoteDesktopCaption_ErrorMessage
exit sub
end if

Comment out the second part of that statement. To do that just add single quotes at the start of each line like so:

‘if strcomp(version,”6.0.6000″) < 0 then
‘ msgbox IncorrectClientVersion_ErrorMessage, 0, RemoteDesktopCaption_ErrorMessage
‘ window.close
‘ exit sub
‘end if

Do not use the Edge browser and ensure that the RWW site is in compatibility mode.

Unable to load HTTP webpages – SBS 2011 and Server 2008

If you are unable to load HTTP web pages however secure (HTTPS) webpages load fine then you need to ensure this registry entry is in place. This should be part of your initial setup process for SBS 2011.

  1. Start Registry Editor (Regedit.exe).
  2. Locate the following registry key:
  3. On the Edit menu, click New, click DWORD (32-bit) Value , and then add the following value:
    Value: MaxCacheTtl
    Data Type: DWORD
    Data value: 0x2A300  (172800 in decimal = 2 days)
  4. Click OK .
  5. Quit Registry Editor.
  6. Restart the DNS Server service.

This key determines how long the DNS server can save a record of a recursive name query.

More info here.