To list logged in users with Powershell:
Get-WmiObject –ComputerName $PCNAME –Class Win32_ComputerSystem | Select-Object UserName