ADSI scripting template that runs the script against a list of computers found in a text file named C:\Scripts\Servers.txt. In the text file, computer names should be listed one computer per line.

Visual Basic
Edit|Remove
On Error Resume Next

Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\scripts\servers.txt", ForReading)

Do Until objTextFile.AtEndOfStream 
    strComputer = objTextFile.Readline

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

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

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

Loop

objTextFile.Close