Logging how much time user was active over the day

  • Thread starter Thread starter getanin
  • Start date Start date
G

getanin

Guest
Hello,

I want to created script that will log and calculate how much time user was
connected to terminal server and how much of that time user do something,
meaning I must exclude from active_time idle_time. I found command query
user that will return me how much time user has been idle.
My process:
1. query user - query terminal server users every minute and write that info
into file
2. If variable user1 exist and idle_time is dot don't increment variable
user1_idle
3. If variable user1 exist and idle_time is not dot increment variable
user1_idle for 1 (and every time it parse next log file increment for one)
4. If variable user1 exist and idle_time is dot stop increment variable
user1_idle
5. If variable user1 exist and idle_time is not dot increment variable
user1_idle
6. do this loop until variable user1 exist
7. now we must calculate active_time, we will do that
(logoff_time-logon_time)-idle_time

Is this correct algorithm for this problem? Is there any easier solution, or
maybe program that can monitor user time by idle_time also?

Regards
 
Re: Logging how much time user was active over the day

You have third party solution at www.terminalserviceslog.com

Data that is captured:
Connection start (date and hour)
User
Duration
IDLE time
Active time
Disconnected session time
Connection end (date and hour)
Status


Frane
 
Back
Top