This is an old trick amongst seasoned Citrix/Terminal Server admins, but I only discovered it recently and have found it invaluable. Whilst logon time is the single most important thing to a user, and something I will cover in a future post, logoff times can also become a PITA for users if they hang unnecessarily. You know, especially if they are the type who insist on shutting their device down before they will go home.
Logon delays need a lot of investigation, but logoff – there’s really no need to do anything too drastic. If it’s taking so long to log off that users are getting reconnected to a partially logged-off session when they log back in, then yes, some heavy action is required, but for logoff times of a few minutes, you can simply bypass it by using this trick. I can recall Symantec Endpoint Protection once increased a client’s logoff time by nearly two minutes, and they were a bit peeved about it, until we implemented this little tweak.
In every Windows system with RDS/Terminal Services installed there exists an executable called
tsdiscon.exe. This was generally used for logging off sessions from the command line (see
http://support.microsoft.com/kb/321705 for a full description). However, we can use an AppSense Environment Manager logoff action to run this command before any other logoff commands or processes, giving the user the impression that the session has already ended, letting them head off home out of the door whilst the logoff completes in a disconnected state. As it’s just disconnected, and not reset, the user’s processes will still end gracefully and any other actions that need to be done at logoff will complete quite cheerfully in the background.
You don’t need AppSense EM to do this – a logoff script via Group Policy will suffice quite well, but as this is how I generally deploy it I thought I would show how it’s done in this fashion.