Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Discovering Users Loged on

Status
Not open for further replies.

SteveAudus

Technical User
Oct 4, 2001
409
GB
Is there a quick way of finding out who is logged onto what machine on my network?

Could I write a batch file to echo back a list of machines and their present user?

I know I can get this information from Server Manager,
but I need it in a simple form for a Teacher to read.

Steve Audus
Chaucer Community School.


 
From the resource kit......

::Maybe something like this
xcopy c:\ntreskit\whoami.exe \\%1\shared_name\winnt
xcopy c:\ntreskit\rcmdsvc.exe \\%1\shared_name\winnt
sc \\%1 create "Remote command" binpath= c:\winnt\rcmdsvc.exe
sc \\%1 start "Remote Command"
rcmd \\%1 c:\winnt\whoamI.exe >>c:\temp\current_user.txt
xcopy \\%1\shared_name\temp\current_user.txt c:\batchfile_dir
::Don't know, Is this something along the lines that you wanted?


I can easily write a perl script to do this for ever machine in the domain, let me know if this is on the right track! HTH - Mike
 
Well, actually the above was what I was thinking.

(RCMDSVC.exe) is the file that you copy to your client. You then setup a service, name it what ever you like, the above is "Remote Command", to call on the executable.

(RCMD.exe) is the executable you call from your command line to remote into the clients macine (RCMDSVC.exe) and you are know running as a back ground process with YOUR user rights.

Try this batch and change the sharename
The share_name has to point to the root of C: in this example, and the NTresKit must be installed on your c drive in a folder called ntreskit. Of course you can change this. Run batch like so:

mybatch.bat [Hostname]

of course omit the [] when running

xcopy c:\ntreskit\whoami.exe \\%1\shared_name\winnt
xcopy c:\ntreskit\rcmdsvc.exe \\%1\shared_name\winnt
sc \\%1 create "Remote command" binpath= c:\winnt\rcmdsvc.exe
sc \\%1 start "Remote Command"
rcmd \\%1 c:\winnt\whoamI.exe >>c:\temp\current_user.txt
mkdir c:\temp\%1
xcopy \\%1\shared_name\temp\current_user.txt c:\temp\%1
del \\%1\shared_name\temp\current_user.txt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top