Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


December 08, 2003

Find the Name of the Computer a User Is Logged On To

RSS
Subscribe to Windows IT Pro | See More Systems Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

As a member of a technical support team, I've found that determining the name of the computer a user is logged on to is often helpful in handling the user's Help desk request. Knowing the user's computer name lets me use a remote administration tool such as Computer Management, Event Viewer, or a registry editor to connect to the computer and troubleshoot the problem. I wrote the script ObtainCompNames.vbs, which Web Listing 1 (http://www.winnetmag.com/windowsscripting, InstantDoc ID 40879) shows to obtain users' computer names from the network.

ObtainCompNames.vbs uses netsh.exe, a utility that lets you retrieve WINS name table information from remote systems and perform WINS database administration from the command line. You can find netsh.exe in your Windows OS's Administration Tools Pack. In the script, netsh.exe accesses your company's WINS database and retrieves the IP address associated with the username you enter.

For ObtainCompNames.vbs to work in your environment, you need to install Windows Script Host (WSH) 5.6 and the latest version of the Administration Tools Pack for your OS. WSH 5.6 gives you access to the WScript.Shell object's Exec method, which you need to capture and manipulate the netsh.exe utility's output.

To use ObtainCompNames.vbs, you must have read access to your company's WINS server. You also need to know the WINS server's name, which you must specify in the script. Listing 2 shows the code that you need to customize. In this code, replace WinsServerName with the name of your WINS server.

End of Article



Reader Comments
I've also found it very useful to find out where users are logged onto. Especially when users leave you a message, then by the time you call back they are out to lunch or away from their desk. Often, if you can determine which computer they are logged onto or use, you can finish the task before the user gets back.

This is a good method, but my favority tool by far is called User Locator from Motivate Systems. You can download it for free on their website (http://www.motivatesystems.com).

No only does it list computer(s) the user is logged onto very very fast but it also bind common tools to one click button. This tools has saved me loads of time, and I recommend it to everyone. It's the bomb!

mailscottw November 12, 2007 (Article Rating: )


Whoops, there is also a direct link to this tool:

<a href="http://www.motivatesystems.com/User_Locator.asp">http://www.motivatesystems.com/User_Locator.asp</a>

mailscottw November 12, 2007 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Understanding File-Size Limits on NTFS and FAT

A general confusion about files sizes on FAT seems to stem from FAT32's file-size limit of 4GB and partition-size limit of 2TB. ...


Scripting Whitepapers From Development to Production: Streamlining SharePoint Deployment with DocAve Deployment Manager

Related Events Configuration Manager SP1 and R2 Overview

Check out our list of Free Email Newsletters!

Scripting eBooks Keeping Your Business Safe from Attack: Encryption and Certificate Services

Best Practices for Managing Linux and UNIX Servers

Building an Effective Reporting System

Related Scripting Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement