This PowerShell script will allow you to enter a remote machine name and will return the machine name and currently logged on user name and write the results to the active window.
PS1 Script:
$strComputer = "."
$Var =GWMI -Comp $strComputer -CL Win32_ComputerSystem
"Machine Name: " + $Var.Name + " User Name: " + $Var.UserName
No Comments