' Listing 1: Main Block of Code in AddComputers.vbs Dim strcomputer filename = WScript.Arguments(0) Set objdict = CreateObject("Scripting.Dictionary") Set objfso = CreateObject("Scripting.FileSystemObject") Set objshell = WScript.CreateObject("WScript.Shell") ' Check for the existence of the input file. If objfso.fileExists(filename) = False Then WScript.Echo "Filename : " & filename & " does NOT exist." WScript.Quit End If ' Convert the group name into a DN. dn_grpname = dn(WScript.Arguments(1)) ' Check for the existence of the group. Set objgroup = GetObject("LDAP://" & dn_grpname) If Err.Number <> 0 Then On Error GoTo 0 WScript.Echo "Global Group not found :" & WScript.Arguments(1) WScript.Quit End If Set objtextfile = objfso.OpenTextFile(filename,1) ' Read the input file and store the computer names in a Dictionary object. i=0 Do Until objtextfile.AtEndOfStream strnextline = objtextfile.ReadLine objdict.add i, strnextline i = i+1 Loop ' For each computer name listed in the Dictionary object, call the Add function. For Each objitem in objdict strcomputer = objdict.item(objitem) Add(strcomputer) Next