I played a bit with the command window.
If I input "net view", then a list with computer
names active on my LAN results. With
"net view > pcnames.txt" you get the same results in
that specified file.
A script could take care for this command and
thereafter use these computer names to search for
the associated user names in the next way.
' Returns the user name of the user currently logged on
' to a remote computer. To use this script, replace
' RemoteComputer with the name of the remote computer
' you want to check.
' Script Code
strComputer = "RemoteComputer"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
Wscript.Echo objComputer.UserName
Next
' Source : The System Administration Scripting Guide,
' part of the Windows .NET Server Resource Kit.
' For more information, contact
scripter@microsoft.com.
I hope you can use this idea.
<message edited by didorno on Wednesday, July 20, 2005 8:54 AM>