I Have been asked by a client to calculate average login times for machines and users. So far I have found that the event logs some boots that take longer than the thresholds set by the keys found at:
HKLM\Software\Microsoft\Windows\CurrentVersion\Diagnostics\Performance\Boot
But the keys seem to be locked so I can't edit them to make the thresholds lower to ensure logging of every boot. Is there any methods for finding login times for each log on that is verbose enough to tell the user that is logging in and possible more detailed information, this also needs to be light enough to run on every login and not cause noticeable effects to the user.
Best Answer
I was recently asked to do a very similar thing but to include bootup and logon times and allow for historical reference. so the powershell script below does the following:
So the script is meant to run via scheduled task or on some schedule if you have SCCM perhaps (not during logon so as not to change the logon at all). the nice thing is you can change the PCname to anything else to run it from your own PC and get the data from a remote computer (although the username would show up as your own) to troubleshoot and verify the numbers.
I took it another step and used SharePoint to create a list of external data (using BCS) so they have a nice front end GUI. Script below, I've left in most of the commented lines I used while writing it:
In this last SQL section there is a commented out few lines offering another method (security-based) to input into SQL without needing some password in plaintext.