List of Logged on Terminal Server Users

Posted on 2008-11-18
Medium Priority
Last Modified: 2013-11-21
Some users are not logging out of their Terminal Server session at home time.
Now, if I log onto the Terminal Server as Admin, and launch Task Manager, I can get a list of uers.
However, I'd rather run this at 8pm. Is there a way to get a report of the logged on users as at 8pm?
Either through some Server 2003 tool, or through VB.net.
Question by:jdhackett
  • 2

Expert Comment

ID: 22984009
If you are having SSh server running on the machine, you can connect to the machine using ssh and run the command "query session" which will give the following details
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE.

Try to automate this
LVL 17

Expert Comment

ID: 22984060
Create a little batch file..
with content:

query session > loggedonuser.log

This will create a file with the current status of the logged on users in the path that the batch file was launched from.. You can then schedult this and look at it remotely...

Author Comment

ID: 22985380
Good stuff. Is there a way I could get the date into the file name, so I have a different log per day?
LVL 17

Accepted Solution

JohnGerhardt earned 2000 total points
ID: 22986182
Try this..

set day=%date:~0,2%
set month=%date:~3,2%
set year=%date:~6,4%

set newdate=%day%%month%%year%
query session > %newdate%.log

should create a file with the date + ".log"

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…

621 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