Solved

Ip Address

Posted on 2012-03-29
6
288 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Unlike scripting languages such as C# where a semi-colon is used to indicate the end of a command, Microsoft's VBScript language relies on line breaks to determine when a command begins and ends. As you can imagine, this quickly results in messy cod…
Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 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