Page 1 of 2 12>
Topic Options
#65773 - 2002-05-28 02:14 PM HowTo determine IP Address
Jacks0r Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 23
Loc: Berlin, Germany
Hi,

i want to set the default printer on a Windows NT40 Terminal Server for each Terminal-Client.
But i need the Client-IP. How can i determine it?
Nameresolution does not work, cause theres no WINS or DNS.

Thx

Jacks0r

Top
#65774 - 2002-05-28 02:18 PM Re: HowTo determine IP Address
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Welcome to the board.

Did you try the macro @ipaddress0 macro?
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#65775 - 2002-05-28 02:19 PM Re: HowTo determine IP Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You can't. You can however use the env var %CLIENTNAME% to at least ascertain the client.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65776 - 2002-05-28 02:19 PM Re: HowTo determine IP Address
Jacks0r Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 23
Loc: Berlin, Germany
Hi,

yes, i've tried the Macro, cause it gives the Server-IP.

Jacks0r

Top
#65777 - 2002-05-28 02:21 PM Re: HowTo determine IP Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
MCa,
Everything you run on the server runs in the context of the server so only server info would be revealed. Only that info that the server collects on the client is available.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65778 - 2002-05-28 02:56 PM Re: HowTo determine IP Address
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I think the bigger question here, is why isn't there any Name resolution and can some form be implemented (WINS, DNS, or even that gastly LMHOSTS)?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#65779 - 2002-05-28 03:43 PM Re: HowTo determine IP Address
Jacks0r Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 23
Loc: Berlin, Germany
Hi,

first thx to all.
OK, in my testenvironment now i runs an WINS-Server under Windows NT40 Server.
Unfortunely many of my clients log on locally and not on a dömain.
Thats causes that i have to set the default printer per client-IP-range (printers connected on a HP Jetdirect).
E.g.

Client IP: 10.20.33.50
ClientName: Wilma

On the Terminal-Server is a local printer installed (port: 10.20.33.20_P1, this is the HP Monitor), the Printer is shared as "HP4000-1".

The specific problem is, is must set the default-printer per each terminalclient to its location.
E.g.
"Wilma" is connectet to the Server and prints per default on "HP4000".
So, for each location is a printer installed.
Now an exampel of my script:

$IPAddress=@IPAddress0
$oct1 = LTrim(Substr($IPAddress, 1, 3))
$oct2 = LTrim(Substr($IPAddress, 5, 3))
$oct3 = LTrim(Substr($IPAddress, 9, 3))
$oct4 = LTrim(Substr($IPAddress, 13, 3))
$IPAddress = "$oct1.$oct2.$oct3.$oct4"

SELECT
CASE "$oct2.$oct3" = "20.33" ; 2nd & 3rd octet of the Client IP
IF SetDefaultPrinter ("HP4000-1") = 0
CASE "$oct2.$oct3" = "20.36"
IF SetDefaultPrinter ("HP4000-2") = 0
CASE 1
SetDefaultPrinter ("HP4000-3")
ENDSELECT

[Edit]
The terminal-server and the client are not in the same sunbet and the printserver is located at the client.

[ 28 May 2002, 15:46: Message edited by: Jacks0r ]

Top
#65780 - 2002-05-28 04:40 PM Re: HowTo determine IP Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jacks0r,
In your last post you don't really say at what juncture you are and where you intend to go. As mentioned, KiX runs on the server, not the client, so commands and macros apply to the server.

If you have a %CLIENTNAME% 'Wilma' with the IP '10.20.33.50' and you did a lookup on the client (ping or NBTStat) could you not return the IP?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65781 - 2002-05-28 05:15 PM Re: HowTo determine IP Address
Jacks0r Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 23
Loc: Berlin, Germany
Hmm,
ok, my english is not really good.
Im trying it again.

Our agencys are located all over the country.
They got differend subnets.
In every subnet is a printserver located.
The terminal server has a hp-jetdirect-connection to each printserver.
The clients have no desktop in their ts-session, the applications start automatically.
Also they can only print on their default-printer.
The client himself doesn't have a connection to the printservers. All the printjobs run through the terminal-server.
Now i must set the default-printer per IP-Range.
Cause, a ini-File or a host-file is not workable. I have too many clients. The administration-effort ist expensive.

Regards

Jacks0r

Top
#65782 - 2002-05-28 07:32 PM Re: HowTo determine IP Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jacks0r,
When it comes to Terminal Server specific solutions, I doubt you will find a 'made to order' solution. Simply by restating your need, it is not likely that someone will develop a solution.

I a willing to work with you but will not hand you a solution. You have yet to answer my question as to whether you can resolve the %CLIENTNAME% to an IP.

I am confident there is not a pure KiX solution. Perhaps posting to a Citrix forum may give better results.

CITRIX FORUM
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65783 - 2002-05-30 12:47 AM Re: HowTo determine IP Address
Jacks0r Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 23
Loc: Berlin, Germany
OK, i have a fix for this problem.
All you need is a .dll and a little vbs-code.

wtsmanager.dll

Code:

$WTS = CreateObject("WTSManager.Shell")
$clIP = $WTS.MyIPAddress
$clName = $WTS.MyClientName
MessageBox ("My computer name: $clName @CRLF My IP address: $clIP","Test", 4160)

Serversided it runs only under W2K. If the Client runs NT4.0 Workstation you must have installed the TS-Client from W2K, elsewhere it dont works.
I think, it caused by the RDP5-protocol.

Jacks0r

[ 29 May 2002, 16:17: Message edited by: Jacks0r ]

Top
#65784 - 2002-05-30 02:14 AM Re: HowTo determine IP Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jacks0r,
Does this mean you have a working solution or does it mean you'll have to upgrade to Win2k?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65785 - 2002-05-30 03:11 AM Re: HowTo determine IP Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Look also at http://thethin.net/clientinfo.zip

[ 30 May 2002, 06:08: Message edited by: LLigetfa ]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65786 - 2002-05-30 06:50 AM Re: HowTo determine IP Address
Jacks0r Offline
Fresh Scripter

Registered: 2002-05-28
Posts: 23
Loc: Berlin, Germany
I have 2 test-environments, NT4 and W2K Terminal-Servers.
I've tested it in both environments with NT and W2K-Clients.
Under NT with RDP4 the request of the IP doesn't work.
So i've intalled the clientsoftware from W2K on NT and then i've got the IP. (me was very happy about it).
The MS Terminal Services Advanced Client (TSAC) also provides RDP5 (my clients also connect through the intranet).
But, anyway i need the RDP5-protocol for many Dialin-Clients (redirection of the printerports). Therefor the produktiv server will be run under W2K.

Today i will check, when i install the W2K Clientsoftware on a NT-TS, if the TS is updated to RDP5.

Summary for the Clients:
You don't have to upgrade the clients to W2K. You need only the TS-Clientsoftware from W2K.

[ 30 May 2002, 06:51: Message edited by: Jacks0r ]

Top
#65787 - 2002-11-07 08:34 AM Re: HowTo determine IP Address
Anonymous
Unregistered


Hi,

I need to obtain the client IP-address from the WTS users + if possible the client OS (95/98/NT/2K/XP).

The post I found so far all have references to a file "WTSmanager.dll" but I haven't been able to find it anywhere. Can anyone help with this?

Also, does the "clientnfo.exe" support WTS or is it only meant for Citrix usage?

And finally, is it at all possible to retreive the client OS, e.g. through any of the above components?

Any help is higly appreciated!

Thanks,
Nicolaj

Top
#65788 - 2002-11-07 02:58 PM Re: HowTo determine IP Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I would email you the DLL but you hid your email address so cannot. ClientInfo is only for Citrix ICA.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65789 - 2002-11-07 03:17 PM Re: HowTo determine IP Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The author of the original WTSManager.dll has disappeared from the web. A search of his name only turns up a list of prisoners in Cuba.

Howard Bullock has mentioed that he may add WTS properties to his DLL.

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=13;t=000341
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65790 - 2002-11-07 09:36 PM Re: HowTo determine IP Address
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Jacks0r,

you mention Wnt4 TS. Is it possible to upgrade to W2k with Citrix???

If so, Kix may not be needed. Citrix is able to assign a printer to a user!
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#65791 - 2003-03-14 11:56 AM Re: HowTo determine IP Address
Anonymous
Unregistered


I'm using the WTSManager.dll in my logonscripts to retrieve the IP-address of the client connecting to the WTS server and it works...most of the time. It seems that some times it gets the wrong IP-address - and if I compare my finding it seems that the incorrect IP-address belongs to another user currently logged on to the same WTS server.

Has anyone else seen this before? Anyone using the WTSManager.dll at all?

And does anyone have any idea of what might be wrong?

Thanks,
Nicolaj

Top
#65792 - 2003-03-14 02:46 PM Re: HowTo determine IP Address
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
quote:
The author of the original WTSManager.dll has disappeared from the web. A search of his name only turns up a list of prisoners in Cuba.
What the...?! Sorry, had to say something [Big Grin]
_________________________
The tart is out there

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1003 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.038 seconds in which 0.013 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org