ADSI scripting template that runs the script against all the computers listed in an Excel spreadsheet named C:\Scripts\Servers.xls. The computer names should be listed in column A of the spreadsheet, one computer per row, and with no blank cells cells between rows.

Visual Basic
Edit|Remove
On Error Resume Next

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\servers.xls")
x = 1

Do Until objExcel.Cells(x, 1).Value = ""
    If objExcel.Cells(x, 1).Value = "" Then
        Exit Do
    End If

    strComputer = objExcel.Cells(x, 1).Value 

    ' =====================================================================
    ' Insert your code here
    ' =====================================================================

    Set objComputer = GetObject("WinNT://" & strComputer & "")
    objComputer.Filter = Array("User")
    For Each objUser in objComputer
        Wscript.Echo objUser.Name
    Next

    ' =====================================================================
    ' End
    ' =====================================================================

    x = x + 1
Loop

objWorkbook.Close
objExcel.Quit