Page 1 of 1 1
Topic Options
#122045 - 2004-07-01 08:28 PM Remote Machine IP from UserName
chmod Offline
Fresh Scripter

Registered: 2004-06-01
Posts: 24
Loc: Sacramento, CA
Does anyone know how I can get a LAN IP address based on remote logged in UserName (without using the NBTSTAT command)?

Example: Help Desk Tech wants the IP address of the LAN Domain User "JDOE"

Top
#122046 - 2004-07-01 08:58 PM Re: Remote Machine IP from UserName
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
query all the DCs for the logon events for that user id. (not an easy method)

have your logon script log userid, wksta, IP, mac, and timedate to a file
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#122047 - 2004-07-01 09:04 PM Re: Remote Machine IP from UserName
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Take a look here for an advanced method of logging the user logons.

My Computer Info for Helpdesk use Part 3
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=116475

Top
#122048 - 2004-07-01 10:07 PM Re: Remote Machine IP from UserName
chmod Offline
Fresh Scripter

Registered: 2004-06-01
Posts: 24
Loc: Sacramento, CA
The logging is good idea, if the user only logged into a single PC. Most of our users have 2 PCs. How would I know what log to get and where? If it's one big log, thats going to be a BIG log.

How do I query the PDC's event log?

Top
#122049 - 2004-07-02 04:03 AM Re: Remote Machine IP from UserName
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Use the ReadEventlog() UDF to query the DCs. BTW, you will have to query ALL DCs to determine where a user is logged in.
_________________________
There are two types of vessels, submarines and targets.

Top
#122050 - 2004-07-02 06:48 AM Re: Remote Machine IP from UserName
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
You would have individual logs for each COMPUTER so that if a new user logged on, it would update/overwrite the log with the current users details.

You could use a script then to read all of the logs and look for a specific user name and then have it tell you which log file it resides in.

I have a code example if you really want to pursue this method.

The DC query method is not very practible for organizations that have DC located around the World. On AD it is not as much of an issue as the user should be pointed to a local controller instead of a random list of 3 like NT 4 does.

Top
#122051 - 2004-07-03 05:05 AM Re: Remote Machine IP from UserName
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The question is whether it's more efficient to query the DCs for a specific event inside a specific time window or potentially text-based log files on hunreds of computers. alternatively, one could also use central database update running as a spawned KiXtart script for logging purposes. However, that raises a multitude of other issues at which point the DC query might become the more attractive method.
_________________________
There are two types of vessels, submarines and targets.

Top
#122052 - 2004-07-03 11:28 AM Re: Remote Machine IP from UserName
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Yes, Domain query locally is much faster. I'm only speaking of those that have DC around the Globe. Often they may be across SLOW links.

In the past a full query of all DC for us would take about 3 days to complete due to such limited bandwidth for some locations.

Logging to a Database such as with similar detail as SMS I think would be the optimum method if you could get it all setup and working and if you have the experience to setup and maintain such a solution.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.062 seconds in which 0.03 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org