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
Who is Participating?
Praveen Kumar BonalaConnect With a Mentor Programmer AnalystCommented:
here is a step by step solution for your requirement
jskfanAuthor Commented:
Thank you
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.