WMI LogonSession: get active sessions?

G

Guest

Hi there,

I have written a script that operates on the Win32_LogonSession class in
order to monitor the number of users currently logged on
(interactive/remotely) and to get details about all sessions (also service
sessions, etc.) It works fine, however I experience the problem that for
example instances of Win32_LogonSession still exist when a user has logged
off again. When I log on remotely, a new logon session is created immediately
- but I'm not able to detect log offs immediately. Sometimes sessions are
removed from the Win23_LogonSession class really quick, sometimes it takes
hours or even longer. How can that be explained (something like "garbage
collection"?) And is there a way to force to delete all instances
representing inactive sessions ?
I appreciate any help or comments!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top