anyone know of a vbscript to scan every pc on your network for pst's and then
just dump out the pc name,dir path info of the location of the pst to a
central text file?

Thanks a lot

Re: scan for pst's by TexasMirty

TexasMirty
Fri Sep 15 09:33:22 CDT 2006

I wrote a script to do something similar a while back.... Perhaps this
could be modified to run against a domain... or list of computers .


'* Filename: Filetype_text.vbs
'* Description: A script utilizing the FSO in a recursive program
'* to find files of a specified type in folders and subfolders
'* and output the results to a tab-delimited text file.
'*
'* This is a useful admin tool to locate MP3, PST, or other files.
'* It can be run against local drives, mapped network drives, or
'* a UNC path (\\servername\share).
'*
'* Unlike other scripts that delete the files, this one reports them.
'* You can take the resulting tab-delimited file, bring it into Excel
'* and present it to your manager, who will be quite impressed!
'*
'* Created: October 10, 2002
'* Resources used: "Windows Admin Scripting: Little Black Book
'* by Jesse M. Torres - chapter 3: File Management
'*
'**********************************************************

'* This first section creates the text file for the results
'* Modify the location of the text file if needed


Const ForAppending = 2


Set objFSO = CreateObject("Scripting.FileSystemObject")


Set objTextFile = objFSO.OpenTextFile("c:\pstlist.txt", _
ForAppending, True)


'* Now we set what file type we are looking for
'* For example, you can search for PST or MP3 files


Set FSO = CreateObject("Scripting.FileSystemObject")
sDIR = "\\fs\share"
sEXT = "pst"


set objDIR = GetFolder(sDIR)
GoSubFolders objDIR


'* Rather than show the results on screen, they are sent to a text file

'* We are sending file path and name, file size, type,
'* date modified, date created into a tab-delimited text file.


Sub MainSub (objDIR)
For Each efile in objDIR.Files
fEXT = FSO.GetExtensionName(efile.Path)
If LCase(fEXT) = LCase(sEXT) Then
objTextFile.WriteLine(efile.path & vbtab & efile.size _
& vbtab & efile.DateLastModified & vbtab & efile.DateCreated)
objTextFile.WriteBlankLines 1


End If
Next
End Sub


'* Including this section to make the query recursive


Sub GoSubFolders(objDIR)
If objDIR <> "\System Volume Information" Then
MainSub objDIR
For Each eFolder in objDIR.SubFolders
GoSubFolders eFolder
Next
End If
End Sub


'* This is needed for the FSO Folder object to work


Function GetFolder(sFOLDER)
On Error Resume Next
Set GetFolder = FSO.GetFolder(sFolder)
If Err.Number <> 0 Then
WScript.Echo "Error connecting to folder: " & sFolder &_
VBlf & "[" & Err.Number & "] " & Err.Description
Wscript.Quit Err.Number
End If
End FUnction


'* Now close the text file and you are done.


objTextFile.Close






tkern wrote:
> anyone know of a vbscript to scan every pc on your network for pst's and then
> just dump out the pc name,dir path info of the location of the pst to a
> central text file?
>
> Thanks a lot