?
Solved

Find User based on IP address or hostname

Posted on 2006-04-07
8
Medium Priority
?
728 Views
Last Modified: 2010-08-05
Hello All,

Does anyone know of a way to find out what user is logged onto a computer if you know the hostname or the ip address?

Here is the situation, it has been determined that a pc is broadcasting traffic which is saturating the network bandwidth. What I have is the ip address of the computer but in an environment of over 150 computers I need to know who the user is in order to find where the computer is located.

If anyone can provide suggestions this would be extremely helpful. Thanks.

Keith
0
Comment
Question by:kwoznica
6 Comments
 
LVL 48

Accepted Solution

by:
Jay_Jay70 earned 672 total points
ID: 16406221
Hi kwoznica,

nbtstat - a ip address

will tell you all!

Cheers!
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 16406276
0
 
LVL 17

Expert Comment

by:Dushan De Silva
ID: 16407802
Actually following will work ;)

nbtstat -a ip address

Or else you can download "Advance Ip scanner" kind of software. Which allows to give specific IP range and list all the details about those machines.

BR Dushan
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
LVL 5

Expert Comment

by:MitchV85
ID: 16408324
Here is a script I have that will tell you exactly who is logged into a remote machine that you can specify by hostname. When the script launches it will bring up a logon prompt and all you have to do is enter the NetBIOS name of that machine and it will tell you exactly who is logged in at that time.

Here it is!


'***********************************************************************************************
'*                                                                               *
'*      This script will allow you to query a computer and see who is currently logged on,                                                        *
'*      provided you have the sufficent permissions.                                                                           *
'*                                                                               *
'***********************************************************************************************

On Error Resume Next

strComputerName = InputBox("Enter the name of the computer you wish to query", "Logon Session Spy")
            If strComputerName = "" Then
                  Wscript.Echo "You must enter a valid data string into the computer name field."
                  Wscript.Quit
            End If

who = "winmgmts:{impersonationLevel=impersonate}!//"& strComputerName &""
      If Err.Number <> 0 Then
            Wscript.Echo strComputerName & " " & Err.Description
            Wscript.Quit
      End If

Set Users = GetObject( who ).InstancesOf ("Win32_ComputerSystem")

            For each User in Users      
                  Wscript.Echo "The user name for the specified computer is: " & User.UserName
            Next




That should do it for you!

Hope this helps!
Mitch
0
 
LVL 5

Assisted Solution

by:MitchV85
MitchV85 earned 664 total points
ID: 16408325
sorry about that forgot to edit out the comment line at the top. Here is just the script...........




On Error Resume Next

strComputerName = InputBox("Enter the name of the computer you wish to query", "Logon Session Spy")
          If strComputerName = "" Then
               Wscript.Echo "You must enter a valid data string into the computer name field."
               Wscript.Quit
          End If

who = "winmgmts:{impersonationLevel=impersonate}!//"& strComputerName &""
     If Err.Number <> 0 Then
          Wscript.Echo strComputerName & " " & Err.Description
          Wscript.Quit
     End If

Set Users = GetObject( who ).InstancesOf ("Win32_ComputerSystem")

          For each User in Users    
               Wscript.Echo "The user name for the specified computer is: " & User.UserName
          Next




Best of luck,
Mitch
0
 
LVL 18

Assisted Solution

by:carl_legere
carl_legere earned 664 total points
ID: 16413664
add a line in the login script, which runs a script that does this after establishing drive mappings


ipconfig /all > g:\info_%username%.txt

where g is the letter of a common network location that they can all pile up into after the login in the morning, and then you can see with search (find within document on the root of this folder)
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you might need to configure routing based not only on destination IP address, but also on a combination of destination IP address (or hostname) and destination port number. I will describe a method how to accomplish this with free tools. …
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question