find last logged on user with Powershell

You can find the last logged on user to any computer

Get-wmiobject Win32_ComputerSystem -Comp "."

If you would,format your result by adding "| Select Name,Username" command.