#65773 - 2002-05-28 02:14 PM
HowTo determine IP Address
|
Jacks0r
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
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
Welcome to the board.
Did you try the macro @ipaddress0 macro? greetings.
|
|
Top
|
|
|
|
#65776 - 2002-05-28 02:19 PM
Re: HowTo determine IP Address
|
Jacks0r
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
|
|
|
|
#65778 - 2002-05-28 02:56 PM
Re: HowTo determine IP Address
|
Howard Bullock
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)?
|
|
Top
|
|
|
|
#65779 - 2002-05-28 03:43 PM
Re: HowTo determine IP Address
|
Jacks0r
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
|
|
|
|
#65781 - 2002-05-28 05:15 PM
Re: HowTo determine IP Address
|
Jacks0r
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
|
|
|
|
#65783 - 2002-05-30 12:47 AM
Re: HowTo determine IP Address
|
Jacks0r
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
|
|
|
|
#65786 - 2002-05-30 06:50 AM
Re: HowTo determine IP Address
|
Jacks0r
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
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
|
|
|
|
#65791 - 2003-03-14 11:56 AM
Re: HowTo determine IP Address
|
Anonymous
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
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|