Retrieve Lastlogged on user to a computer

I need a powershell command that can retrieve the last logged on user name to a computer.
this is Windows domain.
I found Powershell commands that retrieve current logged on user, but not the last logged on user if the computer has no one logged on to it at the current time.

Any Help?

Thank you
jskfanAsked:
Who is Participating?
 
Praveen Kumar BonalaConnect With a Mentor Programmer AnalystCommented:
Hi,
here is a step by step solution for your requirement

https://4sysops.com/archives/track-user-logons-with-a-powershell-script/
0
 
jskfanAuthor Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.