Written
June 01, 2011
I like this, it's a quick and easy way to discover who the user is, and, if you have only an IP, the computer name as well.
I made two changes to suit my use, first, to prompt for the Computer name or IP, second, to have the result display both,User and Computer Name. I frequently need to identify who is downloading large files through our network. I can easily ID the IP address using our network utility, but it's a chore to look-up, first the computer name, then the user ID from separate lists. This program helps.
Try these changes:
change line 1 to:
strComputer = inputbox("Enter IP address of the computer for which you want the Computer Name and ID of the Logged on User")
change the Wscript.Echo... to:
Wscript.Echo "Logged-on user: " & objComputer.UserName & vbcrlf & "Computer Name: " & objcomputer.name