Sign in to follow this  
Followers 0
Pritam

Retrive Computer name using Login ID on network

6 posts in this topic

#1 ·  Posted (edited)

I have a list of user IDs &amp; I want to find the computer names on which the users are currently logged in. Is it possible???<br>

Edited by Pritam

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

There are a few approaches that I can think of.

If it is in a domain environment (and you are a domain admin) you should be able to examine an event log (which may take some time) to find the most recent login activity for a user and which machine they logged into. To further investigate you can use WMI to verify the current logged in user to a given machine.

Alternatively you could just perform the WMI check on a bunch of machines (shotgun approach). There are examples of how to use WMI in AutoIt on this forum (search for Scriptomatic) and there are event log examples in the help file. You can also use utilities to speed up the event log process (Logparser).

Edited by spudw2k

Share this post


Link to post
Share on other sites

Hello Pritam were you ever able to figure this problem out? I have a solution but I dont know how to automate it. On a domain you can net send the user then use nbtstat -c to show the cache and nslookup the ip. any idea how i can automate this. I can get to the nbstat - c but i have to figure out a way to output that to a file then read the txt file and extract the ip from that?

Share this post


Link to post
Share on other sites

Probably the easiest way, if you have domain authority, is to create a simple "WhoLoggedOn" script and apply it via GroupPolicy. We run a simple script that captures UserName, Login Time, Authenticating DC, OS and ServicePack, Asset Tag and IP address and appends to a file on the network. Helpdesk technicians then use a log parser to check by UserName or Asset Tag.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

We also create a log file when the users log in. Here is what part of the script looks like.

$TITLE = ("Username,Computer Name,IP Address,Time,Date,BSSID,Room");, AP MAC Address")
$Login = (@UserName & "," & @ComputerName & "," & @IPAddress1 & "," & @HOUR & ":" & @MIN & ":" & @SEC & "," & @MON & "/" & @MDAY & "/" & @YEAR & "," & $MAC & "," & $location)

If FileReadLine("servernameshareStudents Log.csv", 1) = $TITLE Then
  FileWriteLine("servernameshareStudents Log.csv", $Login)
 Else
  FileWriteLine("servernameshareStudents Log.csv", $TITLE)
  FileWriteLine("servernameshareStudents Log.csv", $Login)
 EndIf

Share this post


Link to post
Share on other sites

We use a Mysql database and an autoit script to push logon user name, computer name, Ip, date and time, and computer serial to the database. I have a front end VB6 program to retrieve information by various queries. By date, By month, by year, by computer name, by username and so on.... All free just had to built it....


I Break and Fix things... If the surf is up I'm outta here.....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0