View Full Version : Terminal server (W2K)
john.c.stacy
01-29-2003, 11:01 AM
Ok I have a question and I guess it could be more of a challenge. Does anyone know how to reset the session counter for a W2K terminal server WITHOUT REBOOTING the server? I have dug and I have looked and I have been unsuccessful in finding the means at which the counter is run. There has to be a value somewhere wheather it is in the regestry or in a file located on the server where the session number is incrimented.
The value is sessionname=RDP-TCP#X or ICA-TCP#X
you can find it by typing %sessionname% at the command propt or set and look for the environment var sessionname.
Thanks!
Torsten Silbersack
01-31-2003, 05:52 AM
you can make a right mouseclick to the listener Ports ( rdp or / and ica ) and select reset !
Use TSADMIN or MFADMIN/CMC
Noone should work on the Maschines because you'll reset all the sessions. thats the only way I know.
bye
Torsteb
john.c.stacy
01-31-2003, 09:36 AM
This does work for resetting the session ID but not the sessionname variable. If you check your list of environment variables from the command line you will see the sessionname still continues to incrament even after you reset the listener port.
Thanks though =D
mysterywolf
01-31-2003, 09:41 AM
Rwinsta.exe
-----------
Rwinsta.exe resets the session subsystem hardware and software to known initial
values.
Syntax for Rwinsta.exe:
RESET SESSION {sessionname | sessionid} [/SERVER:servername] [/V]
sessionname Identifies the session with name sessionname.
sessionid Identifies the session with ID sessionid.
/SERVER:servername The server containing the session (default is current).
/v Display additional information.
Example: rwinsta 3 /server:cprsrv02 /v
john.c.stacy
01-31-2003, 09:50 AM
I believe this just resets the session that is connected. What I am looking for is the ability to reset the session count of the server not resetting the sessions that are active or in a discon state. the only known way to reset the server session count of the sessionname variable is to bounce the server. I would like to find a different way. I would like to find what on the server is controlling the session count the is incromenting the sessionname variable.
Thanks for the try though =)
mysterywolf
01-31-2003, 10:03 AM
penny's dropped...sorry I couldn't help.
John,
Please keep in mind that I don't have a clue what you're talking about, but I found three documents that may be what you want???
JSI FAQ #5209</font color=blue> (http://www.jsifaq.com/SUBK/tip5200/rh5209.htm><font)
Microsoft's Suggestion - about XP, though.</font color=blue> (https://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/windowsxp/home/using/productdoc/en/ts_cmd_resetsession.asp><font)
ACP Commands</font color=blue> (http://www.acpthinclient.com/TechNotes/Commands.shtml><font)
Hope they're right,
Nana /images/forums/icons/smile.gif
john.c.stacy
01-31-2003, 11:20 AM
hehe thanks for the links but the reset session cmd is one I know about and is designed to just reset and active or disconected session on a terminal server. let me see if I can explain what it is that I am talking about.....
here it goes ;-)....
user logs in and the sessionname variable is definded as:
sessionname=RDP-TCP#50
The next user logs in and there sessioname variable is defined as:
sessionname=RDP-TCP#51
see when users log into a terminal server the environment variable sessionname is defined for them. As more users log in the number is incromented by one. This is how the Terminal server keeps track of which session is which when the subsystem needs to process information to and from sessions through the underlining OS. This number starts at 0 when the server is rebooted and incroments by 1 every time a user loggs in. here is another example. Note: pretend that each instance is a user logging into the server.
sessionname=RDP-TCP#1
sessionname=RDP-TCP#2
sessionname=RDP-TCP#3
ect..... until you reboot the server at which time the count starts from 0 again.
What I am trying to do is to reset this count back to 0 without rebooting the server. The reasone for this is because I map a user defined environment variable to the sessionname. Unfortunatly when the number grows to large the lagecy application that uses the user defined environment variable fails when the count gets above 1000. In my environment this happends daily! and therefore in order to keep the application from failling I have to reboot my servers every night! and as you can guess this blows any Idea of a 5 9's environment out of the water. Though I have no pipe dream about ever beaing able to reach 5 9's with a Windows 2k based system running it as a terminal server I would like to improve the current up time. If I could reset this count back to 0 without rebooting the server I could set the reboot cycle to once a week! Which in my case is a substatual inprovement over the current nightly reboots.
Is any of this making any sence to anyone out there???
John,
Actually, it makes complete sense to me. It doesn't mean I know how you solve it, but you explained it perfectly. And, if I can understand what you're trying to do, believe me, the others here will as well.
Good luck,
Nana /images/forums/icons/smile.gif
john.c.stacy
01-31-2003, 11:27 AM
Thanks! =P
1500 Citrix servers and growing =)
JakeHaze
02-03-2003, 06:50 AM
Nana, I got your message.
John, what version Metaframe are you running?
john.c.stacy
02-03-2003, 07:52 AM
XPe FR2 on W2k Server
1500 Citrix servers and growing =)
JakeHaze
02-03-2003, 07:56 AM
OK, I've been through the CMC and the Connection Configurator and the TS Manager. The only option I can see is to limit your connections to less than 1000 and increase (if required) the number of idle sessions. I'm not even sure this would work, because my farm is set to reboot every Sunday morning and I'm already looking at a fresh count. I'll peek at it on Friday and see if my numbers are still climbing.
Otherwise, I can't seem to find anything that will accomplish this without a reboot.
Have you thought about creating a session variable based on the User ID instead?
Edit:
One more thing. Have you been to any Citrix-specific sites like TheThin.net or ThinClientZone.com or TweakCitrix.com or any Citrix-devoted mailing lists?<P ID="edit"><FONT class="small">Edited by JakeHaze on 02/03/03 08:58.</FONT></P>
john.c.stacy
02-03-2003, 08:22 AM
Well one of the solutions I though of doing was creating a "fake" Variable. Though I have not tested it and do not know if it will work. Unfortunatly this is an Old Openstep app that was ported over to NT then I migreated it to 2000. In both cases the variable was needed by the app inorder to function in a multy users environment.
One solution was to create some sort of file that held a numaric value. Possibley something that will be incromented with a login script. Then just have a script pull the value from the text file and have it set the variable with it. Then set the script also to checkthe file to see how large the number is IE
If %1==1000
goto del
els
goto incro
Something like that to clear the number in the file and reset it to 0. Only problem with this is setting the environment Variable needs to happen from the Domain login script because it runs before 2 of the supporting applications lauch which use this Variable as well. But I think this will work the only thing is I was hopeing for something....... ummm cleaner =)
Thanks though for the attempt.
1500 Citrix servers and growing =)