[THIN] Allow user to reset their own session

  • From: "Lutz, Ken" <KLUTZ@xxxxxxxxxxxxxxxxx>
  • To: "Thin - List (thin@xxxxxxxxxxxxx)" <thin@xxxxxxxxxxxxx>
  • Date: Tue, 9 Dec 2003 07:38:31 -0800

I got this working.  If anyone is interested here is the solution that I came
up with.
 
1) set the HKLM\System\CurrentControlSet\Control\Citrix
        IcaEnableKeepAlive  - Reg_Dword to 1
        ICAKeepAliveInterval - Reg_Dword to 1800 (30 minutes)  (I have my
disconnected user reset time set to 60 minutes)
This setting means that a users session will get reset after just over 1.5
hours, if they do nothing.
 
2) I got a copy of the FINDUSER.exe utility from this web site:
http://www.wizbang.org.uk <http://www.wizbang.org.uk>   (it's part of the
Command line tools download).
 
3) I also had to get the choice.exe utility from the NT Resource kit.
 
4) I then published this script:
<~~~~ Start of Script - watch for word wrap
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>
@Echo off
cls
@ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ECHO ~ Use this procedure to reset all your active Citrix sessions.         ~
@ECHO ~                                                                      ~
@echo ~ By resetting active Citrix sessions you may risk the lose of data!!  ~
@echo ~                                                                      ~
@echo ~ Are you sure you want to reset your active Citrix sessions?          ~
@Echo ~ Respond with Y for yes and N for no (upper case Y or N only).        ~
@echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Choice /C:YN /S Proceed with Citrix session reset?
If errorlevel 2 goto :END1                                          
 
   if exist H:\resetlist.txt del H:\resetlist.txt
 
   %WINDIR%\FindUser.exe %UserName% /server:%WINDIR%\serverlist.txt
>H:\ResetList.txt
 
   for /f "skip=5 tokens=1,4" %%I in (H:\ResetList.txt) do   (set rserver=%%I&
set rsess=%%J& call :DOIT)
 
goto :END2
 

:DOIT
    @ECHO %SESSIONNAME% %RSESS%
    IF {%RSESS%} == {%SESSIONNAME%} GOTO :EOF
    @ECHO RESET SESSION %RSESS% /SERVER:%RSERVER%
    RESET SESSION %RSESS% /SERVER:%RSERVER%
 
 
 
goto :EOF
 
 
 
 
 

:END1
@ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ECHO ~ You chose NOT to reset any Citrix sessions at this time.             ~
@ECHO ~ No Citrix sessions have been reset!                                  ~
@ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pause
 

:END2
@ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ECHO ~                                                                      ~
@echo ~ Please wait until you get the "Saving your settings" message before  ~
@echo ~ you open any other Citrix session.  (Don't click on another NFuse    ~
@echo ~ icon until after you see the "Saving your settings" message.)        ~
@ECHO ~                                                                      ~
@echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pause
<~~~~~~~~~~~~~~~~~~~End of
Script~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>
 
The only thing with this is that it will not reset the session if it is already
disconnected.  It will only reset active sessions.  It will not reset the
session that is running the script (the current active session).
 
The reason I had to write this is because I have some users that would loose
their connection to Citrix (via NFuse and published applications) yet leave
their sessions active to Citrix.  The only way I could recreate this is to
reboot the PC while the Citrix session is active.
 
Ken ...
 
 
 
 
 

-----Original Message-----
From: Lutz, Ken [mailto:KLUTZ@xxxxxxxxxxxxxxxxx] 
Sent: Monday, December 01, 2003 11:11 AM
To: Thin - List (thin@xxxxxxxxxxxxx)
Subject: [THIN] Allow user to reset their own session



Hello everyone.  I have a need to allow users of published applications
(running on PCs via NFuse 1.7) to reset their own sessions.  I don't want to
grant them Admin rights.  Does anyone know of a way to do this?  I am hoping to
find a script or program that I can give to the user that will allow them to
ONLY reset their own sessions.

Thanks for the help! 

Ken Lutz 
Senior Systems Administrator 
Information Systems Department 
Spokane County 
Spokane, Washington  99260 
KLutz@xxxxxxxxxxxxxxxxx 

Other related posts: