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.

Ant

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.

SPAM from your own Domain – Microsoft Exchange 2010

Receiving SPAM from your own domain? It can be very frustrating however the following commands can tweak your receive connector permissions and resolve the issue.

Run the Microsoft Exchange PowerShell window from the Start Menu and run these commands:

Get-ReceiveConnector

That command returns the receive connector names. Find the one that has “Internet Receive” in the name and add that to the following command in place of the red text:

Get-ReceiveConnector “Windows SBS Internet Receive” | Get-ADPermission -user “NT AUTHORITY\Anonymous Logon” | where {$_.ExtendedRights -like “ms-exch-smtp-accept-authoritative-domain-sender”} | Remove-ADPermission

If you’re having issues following that command you can reverse the changes:

Get-ReceiveConnector “Windows SBS Internet Receive” | Add-ADPermission -User “NT AUTHORITY\Anonymous Logon” -ExtendedRights ms-exch-smtp-accept-authoritative-domain-sender

I came across this on a forum somewhere however can’t seem to find it again. Feel free to share the link if you find it.