0
I am running Windows7 on Local PC and Remote Desktop (don't have admin rights on either).
Say the IP address of my PC is 10.*.4.*1
When I connect to a remote desktop, using netstat I am able to retrieve all the connected IP addresses:
C:\>netstat -n | find "3389" | find "ESTABLISHED"
TCP 10.*.4.10:3389 10.*.4.*1:50031 ESTABLISHED
TCP 10.*.4.10:3389 10.*.4.*2:50032 ESTABLISHED
TCP 10.*.4.10:3389 10.*.4.*3:50033 ESTABLISHED
TCP 10.*.4.10:3389 10.*.4.*4:50034 ESTABLISHED
TCP 10.*.4.10:3389 10.*.4.*5:50035 ESTABLISHED
Printing echo %username%
I am able to get the account I am connected to on the Remote Desktop.
I would like to echo the IP address of my Local PC with which I am connected to the Remote Desktop.
Possible duplicate of http://superuser.com/questions/1078181/match-account-ipaddress-of-users-connected-to-a-remote-desktop
– acejavelin – 2016-05-18T11:53:09.890This is a simillar, yet unrelated question - the first one asks for a list of all connected ip addresses and their current accounts on the remote desktop.
This question asks how to print ip address of the local PC a user is using to connect to the said remote desktop. – Igor L. – 2016-05-18T11:59:23.087
I'll let the mods figure out if it is duplicate or not, because the end result of these two questions seems nearly the same, but for one user instead of all, you want to get IP address and user account of connected user. – acejavelin – 2016-05-18T12:10:59.990
As u wish, but I expect the method of retrieving the data to be different – Igor L. – 2016-05-18T12:17:16.837
1Look at the CLIENTNAME and resolve backwards. – acejavelin – 2016-05-18T12:18:16.570