QRYCLIENTIP is a command-line tool for Citrix Servers to query the current session's client ip address. This utility was written for the purpose of allowing one login script to process specific commands for specific IP addresses or IP segments. This utility is FREEWARE and was written by Warren Simondson of Ctrl-Alt-Del IT Consultancy, Australia. www.ctrl-alt-del.com.au Thankyou to the CITRIX SDK available from www.citrix.com/cdn Usage: QRYCLIENTIP [IP_part1] [IP_part2] [IP_part3] [IP_part4] IP_part1 - identifies first number in the IP address IP_part2 - identifies second number in the IP address IP_part3 - identifies third number in the IP address IP_part4 - identifies fourth number in the IP address E.G. QRYCLIENTIP 192 168 1 119 This command will check to see if the client ip address of a session equals 192.168.1.119 The ERRORLEVEL return code shows if the client ip does match the specified IP Address. QRYCLIENTIP also works for part IP addresses. E.G. QRYCLIENTIP 192 168 1 This command will check to see if the client ip address of a session is in the segment 192.168.1.xxx. Example Script: usrlogon.cmd ------------ @ECHO OFF :stage1 QRYCLIENTIP 192 168 5 45 IF ERRORLEVEL 1 goto stage2 rem successfully matched echo This is the correct client ip. echo put other commands here for this ip address. goto end :stage2 QRYCLIENTIP 192 168 2 IF ERRORLEVEL 1 goto end rem successfully matched echo This is the correct client ip segment. echo All clients using 192.168.2.xxx will be processed. echo put other commands here for this app. :end echo put general logon commands here The freeware version is offered AS IS. Ctrl-Alt-Del IT Consultancy has made every effort possible to ensure that QRYCLIENTIP is free of any bugs or errors, however in no way is QRYCLIENTIP to be considered error or bug free. You assume all responsibility for any damages or lost data that may result from any errors or bugs in QRYCLIENTIP. IN NO EVENT WILL Ctrl-Alt-Del IT Consultancy BE LIABLE TO YOU FOR ANY GENERAL,SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR OTHER DAMAGES ARISING OUT OF THIS PRODUCT.