How do I find out who is connected via Remote Desktop to an XPP machine?

  • Thread starter Thread starter Gary Webb
  • Start date Start date
G

Gary Webb

We have a few XP Pro PC's that act as a method of remote desktopping to
other servers via VPN across the Internet for support purposes. We also
access these "RD" machines via remote desktop over the LAN. Whoever connects
to one of these machines logs on as the same (local) user. These machines
are limited to a single RDP session that will give an error message if
somebody is already connected (rather than disconnect them). Therefore, we
are always aware when somebody is currently accessing one of these machines.

I would like to expand this further by trying to find a method of knowing
WHO is connected to these machines (mainly in case somebody has forgot to
disconnect). I have tried to write a few versions of vbscripts that will
look at these machines and pull the user name or computer name of who is
RDP'ing in. I seem to have reached a stage of going around in circles. Can
anybody offer any advice on a method of getting this information?

Thanks

Gary
 
Gary,

I can't help with the script issue, but one strategy for idle sessions is to setup a Group Policy to
disconnect after a timeout period. Go to "Start -> Run"
and type gpedit.msc at the command line. Navigate to the "Local Computer Policy -> Computer
Configuration -> Administrative Templates -> Windows Components -> Terminal Services -> Sessions".
Do this on the RDP host.

--
Al Jarvi (MS-MVP Windows Networking)

Please post *ALL* questions and replies to the news group for the mutual benefit of all of us...
The MS-MVP Program - http://mvp.support.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights...
 
Thanks for the reply. Although users leaving the session open and idle when
finished is and will be a problem, this will not be enough. We still need to
be able to see who is using what system basically, to call them and kick
them off if we have a more urgent requirement to get onto one of the
machines.

So far, I have tried running a script in the run key of the registry of the
XP RD PC to get the client PC name and put it into a key I have made in the
RD machines registry. I have then created a script to allow me to run on any
LAN PC to "get" this client PC name remotely from the registry of the RD
machine. The only problem though is that this always just returns the client
PC name/username, etc. of the RD system itself, not the client that is
RDP'ing to it. This is a problem with my script on the RD system. Not really
the right problem for this group, but I thought I'd check out any other
ideas.

Regards

Gary



Sooner Al said:
Gary,

I can't help with the script issue, but one strategy for idle sessions is to setup a Group Policy to
disconnect after a timeout period. Go to "Start -> Run"
and type gpedit.msc at the command line. Navigate to the "Local Computer Policy -> Computer
Configuration -> Administrative Templates -> Windows Components ->
Terminal Services -> Sessions".
 
One way at this might be to use the "gasp" Messenger service and put up a
pop-up window at the given host machine. I believe you can target messenger
popups by machine or IP, rather than by user.
 
Try qwinsta....

From the command prompt help:
Display information about Terminal Sessions.

QUERY SESSION [sessionname | username | sessionid]
[/SERVER:servername] [/MODE] [/FLOW] [/CONNECT]
[/COUNTER]

sessionname Identifies the session named sessionname.
username Identifies the session with user username.
sessionid Identifies the session with ID sessionid.
/SERVER:servername The server to be queried (default is current).
/MODE Display current line settings.
/FLOW Display current flow control settings.
/CONNECT Display current connect settings.
/COUNTER Display current Terminal Services counters
information.

Jeffrey Randow (Windows Net. & Smart Display MVP)
(e-mail address removed)

Please post all responses to the newsgroups for the benefit
of all USENET users. Messages sent via email may or may not
be answered depending on time availability....

Remote Networking Technology Support Site -
http://www.remotenetworktechnology.com
Windows XP Expert Zone - http://www.microsoft.com/windowsxp/expertzone
 
Nice! Thanks for pointing out this useful command. Unfortunatly though, this
gives me access denied when accessing a remote machine with the /server
switch. When somebody is remote desktopping to that machine, I obviosuly
cannot get to a command prompt on it to enter this command. Even so, I still
don't think this is the answer as when I run it from the system that I have
connected 'To' (remotely whilst connected), it just shows the username as
"administrator" against that session (which is the local user name I have
logged onto Remote Desktop as, and not the user name or computer name I am
connecting from - which is what I am after).

Thanks all the same. I will remember this command.

Gary

Jeffrey Randow (MVP) said:
Try qwinsta....

From the command prompt help:
Display information about Terminal Sessions.

QUERY SESSION [sessionname | username | sessionid]
[/SERVER:servername] [/MODE] [/FLOW] [/CONNECT]
[/COUNTER]

sessionname Identifies the session named sessionname.
username Identifies the session with user username.
sessionid Identifies the session with ID sessionid.
/SERVER:servername The server to be queried (default is current).
/MODE Display current line settings.
/FLOW Display current flow control settings.
/CONNECT Display current connect settings.
/COUNTER Display current Terminal Services counters
information.

Jeffrey Randow (Windows Net. & Smart Display MVP)
(e-mail address removed)

Please post all responses to the newsgroups for the benefit
of all USENET users. Messages sent via email may or may not
be answered depending on time availability....

Remote Networking Technology Support Site -
http://www.remotenetworktechnology.com
Windows XP Expert Zone - http://www.microsoft.com/windowsxp/expertzone

We have a few XP Pro PC's that act as a method of remote desktopping to
other servers via VPN across the Internet for support purposes. We also
access these "RD" machines via remote desktop over the LAN. Whoever connects
to one of these machines logs on as the same (local) user. These machines
are limited to a single RDP session that will give an error message if
somebody is already connected (rather than disconnect them). Therefore, we
are always aware when somebody is currently accessing one of these machines.

I would like to expand this further by trying to find a method of knowing
WHO is connected to these machines (mainly in case somebody has forgot to
disconnect). I have tried to write a few versions of vbscripts that will
look at these machines and pull the user name or computer name of who is
RDP'ing in. I seem to have reached a stage of going around in circles. Can
anybody offer any advice on a method of getting this information?

Thanks

Gary
 
You could just use a Terminal Server so you can have multiple concurrent sessions, or look at a Windows XP Solution like WinConnect Server XP
http://www.thinsoftinc.com/products_winconserver_info.htm

Asking users to think about things like this is a stretch

Patrick Rous
Microsoft MVP - Terminal Serve
http://www.workthin.co

----- Gary Webb wrote: ----

Nice! Thanks for pointing out this useful command. Unfortunatly though, thi
gives me access denied when accessing a remote machine with the /serve
switch. When somebody is remote desktopping to that machine, I obviosul
cannot get to a command prompt on it to enter this command. Even so, I stil
don't think this is the answer as when I run it from the system that I hav
connected 'To' (remotely whilst connected), it just shows the username a
"administrator" against that session (which is the local user name I hav
logged onto Remote Desktop as, and not the user name or computer name I a
connecting from - which is what I am after)

Thanks all the same. I will remember this command

Gar

Jeffrey Randow (MVP) said:
Try qwinsta...
From the command prompt help
Display information about Terminal Sessions
QUERY SESSION [sessionname | username | sessionid
[/SERVER:servername] [/MODE] [/FLOW] [/CONNECT
[/COUNTER
sessionname Identifies the session named sessionname
username Identifies the session with user username
sessionid Identifies the session with ID sessionid
/SERVER:servername The server to be queried (default is current)
/MODE Display current line settings
/FLOW Display current flow control settings
/CONNECT Display current connect settings
/COUNTER Display current Terminal Services counter
information
Jeffrey Randow (Windows Net. & Smart Display MVP (e-mail address removed)
Please post all responses to the newsgroups for the benefi
of all USENET users. Messages sent via email may or may no
be answered depending on time availability...
Remote Networking Technology Support Site
http://www.remotenetworktechnology.co
Windows XP Expert Zone - http://www.microsoft.com/windowsxp/expertzon
other servers via VPN across the Internet for support purposes. We als
access these "RD" machines via remote desktop over the LAN. Whoeve connect
to one of these machines logs on as the same (local) user. These machine
are limited to a single RDP session that will give an error message i
somebody is already connected (rather than disconnect them). Therefore w
are always aware when somebody is currently accessing one of thes machines knowin
WHO is connected to these machines (mainly in case somebody has forgot t
disconnect). I have tried to write a few versions of vbscripts that wil
look at these machines and pull the user name or computer name of who i
RDP'ing in. I seem to have reached a stage of going around in circles Ca
anybody offer any advice on a method of getting this information
 
Back
Top