How can i retrieve the user logged on to a machine over LAN.

Eg: Entering the domain username then get the pc name logged on back as result.