Sorry it to so long to get back to you. Had to write a new script as the one I thought I had did nto do what you are looking for. This one will do it for you. jsut create a text file with a list of workstation names. Call the file WSLIST.TXT. Run this script in the same directory as that file and it will report to you who is logged on each of those workstations. It will create a text file report for you called LogonLocationReport.txt.
'==========================================================================
'
' NAME: ReportLogonLocationsByPC.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL:
' DATE : 3/11/2004
'
' COMMENT: <comment>
'
'==========================================================================
On Error Resume Next
'open the file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")
'open the data file
Set oTextStream = oFSO.OpenTextFile("wslist.txt")
'make an array from the data file
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
'close the data file
oTextStream.Close
For Each strComputer In RemotePC
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkConnection",,48)
Report = ""
For Each objItem in colItems
Report = Report & "UserName: " & objItem.UserName & "is logged in at " & strComputer & vbCrLf
Exit For
Next
Next
Set ts = oFSO.CreateTextFile ("LogonLocationReport.txt", ForWriting)
ts.write Report
Set oTextStream = nothing
set ts = nothing
set oFSO = nothing
I hope you find this post helpful. Please let me know if it was.
Regards,
Mark