"Pegasus [MVP]" wrote:
Quote:
>
> "Jeremy" <Jeremy@xxxxxx> wrote in message
> news:3D3742E7-BDA2-4C63-8518-FD4ED51F1402@xxxxxx Quote:
> >I modified the following script from one I found on the web. It searches
> > through an array of computers and lists all of the user folders found
> > within
> > the documents and settings folders on my student computers. Would it be
> > easy
> > to replace the array with something like 047ds* to just search all student
> > computers in my building?
> > Thanks, Jeremy
> >
> > CODE
> > ----------------
> > '=========
> > arrServers = Array(_
> > "047ds-c303-21.student.cssd.ab.ca",_
> > "047ds-c312-20.student.cssd.ab.ca",_
> > "047ds-cts-05"
> > )
> >
> > strOutputFile = "StudentComputerProfiles.txt"
> > strStartFolder = "C:\Documents and Settings"
> >
> >
> > Set objFSO = CreateObject("Scripting.FileSystemObject")
> >
> > strResults = "Existing Profiles on student computers"
> > For Each strServer In arrServers
> > strFolder = "\\" & strServer & "\" & Replace(strStartFolder, ":",
> > "$")
> > For Each objSubFolder In objFSO.GetFolder(strFolder).SubFolders
> > strResults = strResults & VbCrLf & strServer & " - " &
> > objSubFolder.Name
> > Next
> > Next
> >
> > Set objOutputFile = objFSO.CreateTextFile(strOutputFile, True)
> > objOutputFile.Write strResults
> > objOutputFile.Close
> > Set objOutputFile = Nothing
> > Set objFSO = Nothing
> >
> > MsgBox "Finished. Please see " & strOutputFile
> > '=========
>
> The "net.exe view" command is supposed to give you a list of all computers
> connected to the network. I found it rather temperamental but perhaps you
> can use it to generate a list of PCs.
> Great idea Pegasus, thx. I could use something like this to add the
computer names to the array,
CODE
--------------------------------------
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("c:\computer-names.txt", ForReading)
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
arrServiceList = Split(strNextLine , ",")
Loop
I'd have to start off with creating the file by invoking a cmd like
net view /domain:student>computers.txt
and then something to strip out the '\' characters and the rest of the
messages echoed back.