Server 08 RDP: possible to warn if same user is already connected?

Currently we do some development and monitoring over 1 RDP account (administrator) to a server 2008 r2 machine, as everyone needs to share the same instance of everything to ensure consistency. The problem is that while one person is connected and working away, if someone else tries to connect using the same account, it will boot the first person off and yield control to the second person. The only warning comes a bit too late, when the first person receives a message saying "Another user connected to the remote computer, so your connection was lost".

Is there any known way to warn the incoming user that someone is already connected (similar to the type of message you might get when working with different accounts), or to allow the victim the option of not being booted?


Solution 1:

Some bad news for you: There is no way to get RDP to warn you when you are about to log in to an existing session. It only warns when you are going to log in via RDP and another user is already logged in. sad face


Wait... it might be theoretically possible using remote scripting. You can use the query command and the user option to get a list of logged on users. You could then search for the username that interests you and see if the ACTIVE tag is in the STATE column. From there, you could invoke an .rdp file if the user is not logged on or send a warning dialog if the user is logged on.

It's homemade, but it should work.

Example from one of my Windows servers:

C:\Users\BigKahuna>query user
 USERNAME              SESSIONNAME        ID  STATE   IDLE TIME  LOGON TIME
>BigKahuna          rdp-tcp#0           1  Active          .  3/26/2012 6:51
PM