Solved

Client IP

Posted on 2014-01-07
11
280 Views
Last Modified: 2014-01-16
I can get the system name from a client by using the %clientname% variable. Is there a way to get the client ip address in the same manner?
0
Comment
Question by:tenchulyo
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 39763623
The IP is not stored in a variable.  

If you explained what you needed if for - provided a scenario, a better solution may be offered.  Otherwise, you use IPCONFIG and if you need help with it, run IPCONFIG /? for a list of various options.

You can run a script that can store the IP in an environment variable... but if you can run the script, why do you need to store it in an environment variable?
0
 
LVL 10

Expert Comment

by:acbxyz
ID: 39763651
ipconfig won't help on a terminal server. There are many more or less working solutions. A common one on lan networks is to use the clientname-variable and resolve it back via dns.
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 39763689
Why won't ipconfig work on terminal server... seems to work just fine.  And since we don't know why he wants the information, even if there's some way you're seeing it not work, it may be easily worked around.
0
 

Author Comment

by:tenchulyo
ID: 39763702
I am building a script that sends a remote command (WMI/RPC) and I need to tell the script where to send the command. If I were on the same network I could use:

for /f "skip=1 tokens=2 delims=[]" %%* in (
   'ping.exe -n 1 %clientname%') Do (set "IP=%%*" & goto:exitFor1)
:exitFor1

or just use the clientname itself...

but unfortunately i'm not so I have an annoying solution to map out the IPs, but Id have to keep modifying the script every time someone new was employed here... not cool.
0
 
LVL 10

Expert Comment

by:acbxyz
ID: 39763707
ipconfig only provides the ip address of the terminal server itself. tenchulyo asked for the client ip address.
There are solutions to this problem on the internet using event log sniffer, wmi, different power-shell modules/scripts, "add-on"-specific solutions like Citrix xenapp.

As long as we don't know which version of windows we talk about and if it is plain windows rds or citrix ica or something else, resolving the name back is the most universal.
At least on local networks every device should be listed in a dns server. With external clients usually there is no way back (firewall, nat, authentication, ...) so no problem at all.
0
The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

 

Author Comment

by:tenchulyo
ID: 39763730
It's RDS, no addons. So are you saying there is no way around this? Would you be open to sharing one of these solutions and telling me why you would opt for it? Pros/Cons?
0
 
LVL 12

Expert Comment

by:ktaczala
ID: 39765313
Check out this link, looks like other people need this info too:
http://forums.thedailywtf.com/forums/t/27558.aspx
0
 
LVL 12

Accepted Solution

by:
ktaczala earned 500 total points
ID: 39765366
0
 

Author Comment

by:tenchulyo
ID: 39765866
Thanks ktaczala,

but the last link brings me nowhere...
0
 
LVL 10

Expert Comment

by:acbxyz
ID: 39773271
I never really tested rds/windows based ways. We only use citrix if it is remote desktop and tested a few citrix-based ways, but did it with domain lookup at the end. Sorry.
0
 

Author Closing Comment

by:tenchulyo
ID: 39786520
I'll give it to ktaczala for the attention, but I still couldn't find it...
0

Featured Post

Free book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Fix issue with Win 10 updates that are unable to install 6 56
laptop problem 21 96
Question about consuming GB from Comcast 5 37
Steps to follow for Maintenance of Servers 4 53
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

895 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

18 Experts available now in Live!

Get 1:1 Help Now