I need to get the current user login time, intended as when the current user session started, now I use this cmd code to get it:
for /f "skip=1 tokens=5*" %a in ('quser %username%') do @echo USER SESSION STARTED AT: %b
I want to find a way to get it using C#, but until now I only found ways to get the last time the user logged in inserting the password (the two timestamps are equal if the last user login happened using the password, but not if the user automatically logged in or he used a PIN on Windows 10).
How can I do it (apart from parsing quser.exe output)?
Thanks in advance