[python-win32] Track-session-events

Tim Roberts timr at probo.com
Thu Jun 9 13:26:19 EDT 2016


Rodriguez Orjuela, Jose Luis wrote:
>  
>
> I am writing a python script to track laptop usage. So far I am able
> to do simple stuffs username, machine, logon time, ip address, etc.
> Now I am trying to capture user logoff and sessions changes (screen
> lock). Related to user sessions I found a great blog (
> http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html#isenslogon
> <http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html%23isenslogon>
> ) that explores some of this things but I haven’t been able to
> identify the key parts that I can use in my case. I am looking to
> capture logoff datetime as well as screen lock and store it in a
> remote DB. Here is a fragment of the code in the blog that I am trying
> to use to accomplish this. It would be great if someone can guide me
> in the right direction.
>

I'm confused.  What do you want to know?  The code you posted is from a
Windows service, which gets launched when the machine boots up and
continues to run until the power turns off.  That's the only way you can
catch logoffs and session changes.  Are you writing a service?

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list