General discussion

Locked

Capture of username vs. computernames

By DonaldA-M ·
I have a feeling I'm overlooking something obvious, but here goes - I would like to capture computernames and usernames from an NT network, so that I can populate a file with the usernames and the computers on which they are logged in. Any suggestions?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Capture of username vs. computernames

by chris hirst In reply to Capture of username vs. c ...

Without thinking too deep a WINS server would collect IP,s Usernames and NETBIOS names. You may need to do a bit of manipulation with the exported file to get everything together.

Chris

Collapse -

Capture of username vs. computernames

by DonaldA-M In reply to Capture of username vs. c ...

Poster rated this answer

Collapse -

Capture of username vs. computernames

by Joseph Moore In reply to Capture of username vs. c ...

I do this very thing on my network for auditing purposes. It is very easy.

In the user logon scripts, you can collect the %USERNAME% and %COMPUTERNAME% variables and direct them to a text file. So, you could simply put this in the scripts:

ECHO %username% -- %computername% >>\\SERVER1\SHARE1\Userlogins.txt

And that will make a text file that looks like this:
JOE -- MYPC1
JO2 -- MYPC2
JO3 -- MYPC3
etc.

Now, in my login scripts, I am adding the date and time the users log in, using the NOW.EXE app from the Resource Kit. I wanted to add some kind of date history, so I would know if someone logged in from a machine they should not have logged in. NOW is a nice app to do this with, since it exports date and time, and acts like the ECHO command. You can download NOW from Microsoft here:
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/now-o.asp
(please remove any spaces)

Copy NOW.EXE into the Netlogon share on your PDC and BDCs. So, this is what mylogon scripts all have:
now.exe %username% -- %computername% >>\\SERVER1\SHARE1\Domainuserslogin.txt

And the log file looks like this:

Wed Jan 23 22:58:48 2002 -- JOE -- MYPC1
Wed Jan 23 22:58:48 2002 -- JO2 -- MYPC2
Wed Jan 23 22:58:48 2002 -- JO3 -- MYPC3
etc.

I think the last thing to add is the path to the text file. Make it a path that all users can write a file into, like a public Share directory.

Hope this helps.

Collapse -

Capture of username vs. computernames

by DonaldA-M In reply to Capture of username vs. c ...

Poster rated this answer

Collapse -

Capture of username vs. computernames

by DonaldA-M In reply to Capture of username vs. c ...

This question was closed by the author

Back to Windows Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums