Sunday, 29 July 2007

Find the PC that a certain user is logged on to

Locate a user - Find PCname by username

As an IT guy (or girl) nowadays there is a lot of things you can do to help users with their computer problems remotely. You can take over their PC, you can install software, check and adjust certain parameters, all from a distance. The one thing that remains difficult is to find out the name of the PC that the user is currently working on. ("Fritz" is not an unusual answer when you ask users for the name of their computer.)

Provided the username, this script uses the command "nbtstat -c" in combination with a "net send" to find out the computername of the remote PC. Several vbs and DOS batch scripts exist
already to this end.

This vbs script is more, it is a dashboard. It provides buttons for
  • taking over the user's PC (using remote assistance or remote desktop)
  • listing installed printers
  • showing mapped Network drives ...
You can easily add buttons for tasks that you routinely do on remote PCs . I will give you more examples in some upcoming blogs (deleting temp files, finding out the pst folder location, launch a silent installation of software on a remote PC, etc.)
I have used this script for several years, and I has proven very useful.
Enjoy, and tell me how it works for you!


asavitzk said...

Is this script supported on an XP system that is a member of a 2003 Active Directory domain? I edited the "cmd /c net send" line to include the "/domain:name" switch but it still does not work. I think it's an issue with the nbtstat -c command but I'm not positive.

Paul Price said...

I created a utility called LUSER that attempts to find a users PC / IP just from their username. Once found you can run all manner of admin tasks.

See here for more details and be sure to read the doc: