This is the most often used script. I am using it whenever someone wants to know who is logged on to that workstation or I need to do something on that workstation remotely.
I simply put the workstation name and run the script. The result is in output window in comma separated view: workstation name, NT user...