I have had a long couple of weeks looking into an issue where logoff scripts do not run with XenApp 6.5 published applications or with Windows Server 2008 R2 RemoteApp. Logoff scripts work perfectly from a published desktop, or if the user is added to the local Administrators or Power Users group. To make troubleshooting more challenging, sometimes logoff scripts will work.... just sometimes.
The issue appears to be something to do with wfshell.exe as wfshell.exe hangs at logoff for 10 seconds and if an administrator terminates the users wfshell.exe process the logoff scripts run as expected. A fix suggested in the Citrix forums is to add wfshell.exe to LogoffCheckSysModules as described in CTX891671, but this did not work for me.
I ended up rebuilding a XenApp 6.5 server from scratch for the client who was experiencing this issue and the problem went away, so I know it was something installed which was causing the issue but I could not track down the culprit. The looming "solution" was to rebuild the entire farm! Which I was understandably not that happy with, so I decided to log a case with Citrix who ended up providing a workaround which I have successfully tested.
Add wfshell.exe to the list of processes RDS may safely terminate by adding an entry to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Sysprocs
wfshell.exe = 0 (REG_DWORD)
I pushed this entry out to the farm using Group Policy Preferences which is easy, and ensures the setting will always apply to all farm servers.
I dont know why but wfshell.exe gets lost from ...\SysProcs everytime I reboot the server.
ReplyDeleteSomeone on the Citrix forums also mentioned this. I have applied the registry entry using Group Policy Preferences so have not noticed this issue. Can you try setting this via GPP?
ReplyDeletecan you specify how to do this in GPP please?
ReplyDeleteA quick google search will show you how, for example: http://www.ctxfarmer.com/provisioning-server-using-group-policy-preferences-to-enforce-best-practices/
ReplyDelete