How to know the machine name (or IP) accessing a machine via remote desktop?

We got a machine running Win7 Pro, which is used by several people.
I can use "winrs -r:Win7_machine_name -u:Same_user_name -p:password tasklist"
to find out if there is anyone accessing that Win7 via remote desktop.
(If there is a remote desktop login,  above winrs command shows RDP-Tcp#0.)

Is there any DOS command which can be used to display the remote machine info
(machine name or IP)?  Basically I would like to find the machine accessing
Win7 via remote desktop.   If a DOS command can accomplish that, I could combine
with  winrs.  

If there is no such DOS command, is there other way to get that info?
Who is Participating?
chakkoConnect With a Mentor Commented:
in DOS:
netstat -a -n  | findstr :3389
netstat -a | findstr :3389

will show any remote connections IP using RDP port 3389

David Johnson, CD, MVPOwnerCommented:
you might want to try psloggedon from sysinternals
asugriAuthor Commented:

Thanks a lot.  Although findstr does not work (path issue?), netstat -a -n  or netstat -a gives what I'm looking for.


Thank you for the info.  I prefer to use what is available on Windows.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.