winapi - WIN32 - Last user to login -


is there reliably way determine last user name login system? i've looked @ lsaenumeratelogonsessions() , lsagetlogonsessiondata() require elevation on vista , later (which i'm keen avoid). wmi has same problem (presumably it's calling lsa behind scenes).

i've looked @ "software\microsoft\windows\currentversion\authentication\logonui\lastloggedonuser" in hklm, in testing that's unreliable , doesn't updated.

i'm interested in console logons, rather fast user switching or ts logons.

i've read various articles, have yet come solution.

you might able use audit logon events - requires service have user access right see security log, not full administrator.

eventid 528 indicates logged on, you'd have find recent instance of this.


Comments

Popular posts from this blog

c++ - How to modify context menu of internet explorer using IDocHostUIHandler::ShowContextMenu? -

android - Spacing between the stars of a rating bar? -

c# - Getting "Internal .Net Framework Data Provider error 30" error when column has NULL value -