Solved

Ip Address

Posted on 2012-03-29
6
287 Views
Last Modified: 2012-03-29
I have computers running TS session. I need a script (which will run for their TS Desktop) to give me the IP address of their local computer rather than the server they are connected to

Thanks
Cheers
0
Comment
Question by:Bianchi928
  • 3
  • 2
6 Comments
 
LVL 22

Expert Comment

by:chakko
ID: 37785288
Here is a small program that will report the client IP address.  You can use a batch file to run it.

http://www.ctrl-alt-del.com.au/files/GETTSCIP.zip
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 37785447
0
 

Author Comment

by:Bianchi928
ID: 37785604
That's perfect Rob. Before I give you the marks, should I open a new question or is it possible for you to help me to get the default network printer ip address they're connected to while in TS Mode

Thanks
Cheers
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 65

Accepted Solution

by:
RobSampson earned 200 total points
ID: 37785619
If you add this, does it show the port name of the default printer in terminal server?

Rob.

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT PortName FROM Win32_Printer WHERE Default=True", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
	WScript.Echo "PortName: " & objItem.PortName
Next

Open in new window

0
 

Author Closing Comment

by:Bianchi928
ID: 37785650
Absolute legend

All good mate
Thanks
Cheers
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 37785677
No problem. Thanks for the grade.

Rob.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now