6

I want to know at which hour I logged in to my current session, I don't think uptime in Task Manager is what I'm looking for, because based on my understanding uptime is not the same as current user logged in time.

Is there any PowerShell command I can use in Windows to determine how long I have been logged in to the current session?

Task manager screenshot

Above is the image of my task manger, how can up time be 7 days? I dont understand.

MC10
  • 10,620

1 Answers1

9

query

Note: query.exe requires Windows 10 Pro and higher, and does not exist on Windows 10 Home. See this question for more information: How to get query command on Windows 10

You can run the command query user to find how long your user session has been logged in for. There is also a shorter quser (thanks @Destroy666!). Works in both CMD or PowerShell.

Use LOGON TIME to find out when you logged in and calculate from there.

PowerShell screenshot

net

You can also run the net stats workstation command. It will show you Statistics since ... the time you logged in.

CMD screenshot

MC10
  • 10,620