Jump to content

Retrive Computer name using Login ID on network


 Share

Recommended Posts

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
Link to comment
Share on other sites

  • 1 year later...

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?

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
Link to comment
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.....

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...