Solved

Ip Address

Posted on 2012-03-29
6
286 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

19 Experts available now in Live!

Get 1:1 Help Now