Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logon session timer or record

Status
Not open for further replies.

elmurado

IS-IT--Management
Jul 15, 2003
673
AU
Hi all,
i have written alittle script which auto-reboots the machine that my kids use so as to limit their usage to two hours per session, However, I wanted to know if there is way to keep track of how many times someone has logged in on any given day and use this to prevent logons.
Eg child one has had his 2 hours and has been shutout and tries to login again and so needs to be blocked.

I'm playing with the Win32_logonsession class but I think I may have to use some kid of log reading function to check for certain logon types and check that there have not been more than two perhaps. Or add up all the session times for the day.

I know there's software out there that can do this but as I'm saving up for a new mountain bike frame I can't afford to spend the cash! Invention is the mother of necessity etc....
 
Okay-I could see that I could somehow get the difference between the current time and the StartTime property from the Win32_logonsession class. Then record it somewhere(txt file perhaps). The I could total this for the day and maybe reset it at the end of each day. Then have an if clause in the logon script that I have setup to check if the total time so far today is more than their limit.

(Oh and I have tried windows steady state but it has some big problems with logging in on locked profiles on the old machine we have.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top