I am currently trying to figure out how to view a users login history to a specific machine. This command is meant to be ran locally to view how long consultant spends logged into a server.
I currently only have knowledge to this command that pulls the full EventLog but I need to filter it so it can display per-user or a specific user.
Get-EventLog System -Source Microsoft-Windows-WinLogon -After (Get-Date).AddDays(-5) -ComputerName $env:computername