You are correct Rick. However, I'm not sure that Evan was asking about TS sessions, but rather the clients themselves. A better tool to use is GETTSCIP.exe from http://www.ctrl-alt-del.com.au/CAD_Utils.htm. Warren has rewritten this to work under plain old Terminal Services too, which makes it very versatile...Thanks Warren :) Then in the usrlogon.cmd you can add some lines similar to the following: ::Get the Clients IP address and set an environment variable FOR /F "tokens=2 delims=:" %%A IN ('gettscip.exe') DO SET ClientIP=%%A :: Remove leading spaces SET ClientIP=%ClientIP: =% ::Write a permanent change to the users Environment space SETX ClientIP "%ClientIP%" Cheers. Kind regards, Jeremy Saunders Senior Technical Specialist Infrastructure Technology Services (ITS) & Cerulean Global Technology Services (GTS) IBM Australia Level 2, 1060 Hay Street West Perth WA 6005 Visit us at http://www.ibm.com/services/au/its P: +61 8 9261 8412 F: +61 8 9261 8486 M: TBA E-mail: jeremy.saunders@xxxxxxxxxxx "Rick Mack" <rick_mack@comman der.com> To Sent by: <thin@xxxxxxxxxxxxx> thin-bounce@freel cc ists.org Subject [THIN] Re: OT: Logon scripting 22/11/2006 06:32 AM Please respond to thin@xxxxxxxxxxxx g ----- Message from "Rick Mack" <rick_mack@xxxxxxxxxxxxx> on Wed, 22 Nov 2006 08:32:56 +1000 ----- To: <thin@xxxxxxxxxxxxx> Subject: RE: [THIN] Re: OT: Logon scripting Hi Jeremy, But doesn't @IPADDRESS0 just give you the IP address of the machine you're loggining in to? I don't think that'd help much when the IP address of interest is the ICA client IP address. But the code is fine otherwise. That's basically what we do. The only difference is we use a utility to dump the client IP address, which kix then uses just like your example. eg, in usrlogon.cmd: clientnfo > "%temp%\clientnfo.fil" in the kix script: $file="%temp%\clientnfo.fil ; get ICA client IP address $ipaddr=readprofilestring($file,"WFClientNFO","WFClientAddress") regards, Rick Ulrich Mack Volante Systems, a division of Commander ________________________________ From: thin-bounce@xxxxxxxxxxxxx on behalf of Jeremy Saunders Sent: Wed 22/11/2006 1:14 AM To: thin@xxxxxxxxxxxxx Subject: [THIN] Re: OT: Logon scripting You can do it quite easily with kix...for example: -------------------------------------------------- $ipaddress=LTRIM(SUBSTR(@IPADDRESS0, 1, 12)) $ipsubnet=join(split($ipaddress,' '),'') SELECT CASE $ipsubnet = "172.16.0." $LocalSubnet = "Data Centre" CASE $ipsubnet = "10.3.16." $LocalSubnet = "Melbourne" CASE $ipsubnet = "10.3.17." $LocalSubnet = "Sydney" CASE 1 $LocalSubnet = "Perth" ENDSELECT IF ($LocalSubnet = "Data Centre") USE T: "\\fileserver\share$" ENDIF -------------------------------------------------- Hope that helps. Cheers. Kind regards, Jeremy Saunders Senior Technical Specialist Infrastructure Technology Services (ITS) & Cerulean Global Technology Services (GTS) IBM Australia Level 2, 1060 Hay Street West Perth WA 6005 Visit us at http://www.ibm.com/services/au/its P: +61 8 9261 8412 F: +61 8 9261 8486 M: TBA E-mail: jeremy.saunders@xxxxxxxxxxx Evan Mann <emann@pinnaclefi nancial.com> To Sent by: thin@xxxxxxxxxxxxx thin-bounce@freel cc ists.org Subject [THIN] OT: Logon scripting 21/11/2006 10:15 PM Please respond to thin@xxxxxxxxxxxx g Does anyone happen to do any logon scripting that checks the IP Range/Subnet the computer is on, or, a portion of a computer name (such as a prefix). I'm trying to come up with the best way to consolidate 70+ different logon scripts for 70+ different offices, into one and subnets and computer prefixes are always unique per location. An alternative, and last case option is to check OU membership, but I don't split up OUs by office and would like to avoid doing that. In theory all 3 options sound like they would work just fine, but I'm feeling them out for anyone who has done it in the real world. I'd likely do it with KIX. SBC SITES ONLY GOOGLE SEARCH: http://www.F1U.com <http://www.f1u.com/> ************************************************ For Archives, RSS, to Unsubscribe, Subscribe or set Digest or Vacation mode use the below link: //www.freelists.org/list/thin ************************************************ SBC SITES ONLY GOOGLE SEARCH: http://www.F1U.com <http://www.f1u.com/> ************************************************ For Archives, RSS, to Unsubscribe, Subscribe or set Digest or Vacation mode use the below link: //www.freelists.org/list/thin ************************************************ (See attached file: winmail.dat) ---------------------------------------------------- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ----------------------------------------------------