[THIN] Re: Allow user to reset their own session

  • From: "Stansel, Paul" <Stansel_Paul@xxxxxxxxxxxxxxxxx>
  • To: "'thin@xxxxxxxxxxxxx'" <thin@xxxxxxxxxxxxx>
  • Date: Tue, 16 Dec 2003 09:15:50 -0500

For clarification... will this work with any sessions you have open, or only
ones that you have disconnected from but are still in an Active state?  I
was trying to demonstrate this by launching a published app and then
launching this script, but it didn't disconnect my first session.
 
-Paul
 

-----Original Message-----
From: Jim Kenzig http://thethin.net [mailto:jimkenz@xxxxxxxxxxxxxx]
Sent: Tuesday, December 09, 2003 2:34 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Allow user to reset their own session


Thanks for posting this Ken. I have added this to the Citrix Faq's on
thethin.net giving you credit of course.
http://thethin.net/faqs2.cfm?id=453
<http://thethin.net/faqs2.cfm?id=453&category=2%2C3&sortby=date>
&category=2%2C3&sortby=date
JK
 

-----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx]On Behalf
Of Lutz, Ken
Sent: Tuesday, December 09, 2003 10:39 AM
To: Thin - List (thin@xxxxxxxxxxxxx)
Subject: [THIN] Allow user to reset their own session


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 ...
 
 
 



LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be 
privileged. It is intended for the addressee(s) only. Access to this E-mail by 
anyone else is unauthorized. If you are not an addressee, any disclosure or 
copying of the contents of this E-mail or any action taken (or not taken) in 
reliance on it is unauthorized and may be unlawful. If you are not an 
addressee, please inform the sender immediately.

Other related posts: