I have this code which works perfect.
$computer=read-host"Enter computer name:"
gwmi win32_computersystem -comp$computer | select USername,Caption,Manufacturer
But if run mstsc.exe and I RDC into a remote machine this code does not show me who is RDC'd in. Can PowerShell show you who is in the remote session?