User Profile Last Logon
Question:
I can list all users that have logged on to a machine. Anybody know how to find the last login for
each user/profile of a machine?
Answer:
For the Local user look into using the NT extender:
WntUserGetDat(ServerX,User,"last_logon")
function which can return the last logon date/time for a user.
For domain users check out:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Networks~-~Servers/Microsoft~Client/wNT+Keeping~Track~of~Last~User~Login.txt
User Reply:
The domain users code gives me the last login to the domain for a user not the last login to a pc. I am trying to list all
users of a pc and the date/time of last login on that pc. If you use the reskit delprof you can tell it to delete all
profiles that have not been used for the last # days. Where do they get that info?
Answer:
You're probably going to have to examine the file modification date for the "ntuser.dat" file in each profile folder. That
file is the registry hive that loads up as HKEY_CURRENT_USER when a user logs on to the workstation. The last time that the
file was modified would be the last time that a user was logged on using that profile.
Article ID: W16523
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38