I've been placed in a situation where I'm supporting Citrix end users with no visibility on the Citrix server. One problem I've run into is users restarting their PC without logging out of Citrix first, which causes disconnected sessions and other unexpected behavior. Is it possible to configure the Citrix client to gracefully log off rather than disconnecting when Windows is rebooted?
Unfortunately not through the end client, this is a setting which should be setup by whoever manages the Citrix server and is quick change to make.
Start-> Administrative tools-> Terminal Services Configuration -> Connections -> ICA TCP Properties -> Override user settings -> Disconnect from session.
From here, select override and select a time limit before disconnected sessions are ended.
This should stop any issues caused by users not closing Citrix sessions properly.
boburob, just wanted to add a comment to your reply, but I'm not allowed apparently.
Rather than configuring it on each Citrix server, there are many advantages of configuring it through a Group Policy:
Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limits
That way, you configure it once and can apply to all (or some) Citrix servers. If servers are rebuilt or more servers added, just put them in your Citrix server OU and they will get the settings applied.
As for the original question, there's a logical reason why it's not possible for sessions to reliably log off, when the client is shutdown.
When you initiate a shutdown or reboot, a termination signal is sent to all running services and applications. You can't control in which order they're actually terminated, as some processes might take longer to close than others.
Therefore, some of the components and services required to maintain an active Citrix session, might already have closed before the Citrix client could have initiated a log off on the Citrix server.
When the connection between client and server is taken down, be that due to network problems, client crash or reboot, the session will enter the "disconnected" state.
You might want to allow disconnected sessions to live for some time (say 1 hour), to allow users to roam from client to client (if you wish to enable that), or so that a brief network outage does not log off all sessions.