Recently I ran into an issue with double hop ICA session from a XenApp server. For those not aware of this, this is a situation where you launch xenapp from a local farm and connect to another farm through that XenApp session, hence Double Hop.
The issue is that with changes in Windows 2008 architecture, when processes are changed. In the Citrix Management Console this represents itself as Application Status “Application not running” and no Application name listed. This will prevent XenApp application limits from taking hold.
This message also cannot be turned off as documented here.
REM —Copy all of this text into a notepad and save it as a batch fileREM —to see if a program is running
@echo offsleep 1
REM – This will launch the ICA file. Publish the App in XenApp and call the paramater for the ICA file in c:Admin“C:Program Files (x86)CitrixICA Clientwfica32.exe” c:admin%1sleep 30
:loop
set runningprocess=wfica32.exe
rem —- 1: all one line —-
tasklist /FI “IMAGENAME eq %runningprocess%” /FI “Username eq %username%” | find /I “%runningprocess%” > nul
rem —- 1: end of line
IF %ERRORLEVEL% equ 0 echo %errorlevel%
IF %ERRORLEVEL% equ 1 logoff
sleep 300
goto loop
This script should be pretty easy to edit. Tasklist does not provide errorlevel so I used find to find the process and create the errorlevel. The script will stay resident until the wfica32.exe process is closed and within five minutes of ending the remote ICA session under that user context it will then do a logoff for that user.