List of Logged on Terminal Server Users

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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...
jdhackettAuthor Commented:
Good stuff. Is there a way I could get the date into the file name, so I have a different log per day?
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"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Server OS

From novice to tech pro — start learning today.