?
Solved

How to find the largest PST files on our network.

Posted on 2010-01-11
6
Medium Priority
?
1,272 Views
Last Modified: 2012-05-08
What is the best way to scan our network and find a list of all PST files and what pc's there on?  I am not a programmer or scripter so I may need some help. :)

Thanks!
0
Comment
Question by:goneal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 16

Expert Comment

by:Raheem05
ID: 26285046
Do you have romaing profiles at all?
0
 
LVL 16

Expert Comment

by:Raheem05
ID: 26285050
Roaming*
0
 
LVL 1

Author Comment

by:goneal
ID: 26285061
No roaming profiles.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Accepted Solution

by:
Raheem05 earned 1000 total points
ID: 26285161
OK there is a script which has been published before see below:

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_24665478.html?sfQueryTermInfo=1+network+pst+scan

Hopefully this is what you are looking for
0
 
LVL 20

Expert Comment

by:Satya Pathak
ID: 26286636
Yes you can do it jost go through user profile and C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Outlook.

0
 
LVL 38

Assisted Solution

by:Shift-3
Shift-3 earned 1000 total points
ID: 26288204
Paste the script below into a text file with a .vbs extension.  Customize the contents of the arrContainers array on line 6 with the distinguished names of the OUs to search under.  Running the script will search each local drive on each computer and report the location of the largest .pst file on each one in a comma-delimited text file.

It should be noted that this is not terribly efficient and will necessarily take a very long time to run.  If you could narrow down the location to search on each drive, the script's performance could be considerably improved.


Const ADS_SCOPE_SUBTREE = 2
Const intMB = 1048576
 
On Error Resume Next
 
arrContainers = Array("ou=workstations,dc=yourdomain,dc=com")
strExt = "PST"
strReport = "report.csv"
strQuery = "SELECT DeviceID FROM Win32_LogicalDisk WHERE DriveType = 3"
 
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReport = objFSO.CreateTextFile(strReport, True)
objReport.WriteLine "Computer,Online,Largest " & strExt & " File,Size (MB)"
 
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
 
For Each strContainer in arrContainers
    Set objCommand.ActiveConnection = objConnection
    objCommand.CommandText = _
        "Select Name,distinguishedName From 'LDAP://" & strContainer & _
        "' Where objectCategory='computer'"  
    objCommand.Properties("Page Size") = 1000
    objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
    Set objRecordSet = objCommand.Execute
    objRecordSet.MoveFirst
 
    Do Until objRecordSet.EOF
        strComputer = objRecordSet.Fields("Name").Value
        strLargestFile = ""
        intLargestSize = 0
 
        If PingCheck(strComputer, 1, 500) Then
            Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
            Set colItems = objWMIService.ExecQuery(strQuery)
 
            For Each objItem In colItems
                strDrive = Left(objItem.DeviceID, 1)
                
                strCommand = "cmd /c @echo off & dir " & Chr(34) & "\\" & strComputer & _
                    "\" & strDrive & "$\*." & strExt & Chr(34) & " /a:-d /b /s"
 
                Set objWshScriptExec = objShell.Exec(strCommand)
                Set objStdOut = objWshScriptExec.StdOut
 
                Do Until objStdOut.AtEndOfStream
                    strFile = objStdOut.ReadLine
                    Set objFile = objFSO.GetFile(strFile)
                    intSize = objFile.Size
                    
                    If intSize > intLargestSize Then
                        intLargestSize = intSize
                        strLargestFile = strFile
                    End If
                Loop
            Next
            
            objReport.WriteLine strComputer & ",True," & Chr(34) & strLargestFile & Chr(34) & _
                "," & Round(intLargestSize/intMB, 1)
        Else
            objReport.WriteLine strComputer & ",False"
        End If
        
        objRecordSet.MoveNext
    Loop
Next
 
objReport.Close
 
Function PingCheck(strTarget, strPings, intPause)
    Const ForReading = 1
    
    Set objShell = CreateObject("WScript.Shell")
    strTempDir = objShell.ExpandEnvironmentStrings("%temp%")
    strTempFile = strTempDir & "\script-" & strTarget & ".txt"
 
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    objShell.Run "%comspec% /c ping -n " & strPings & " -w 100 " & _
        strTarget & ">" & strTempFile, 0, True
        
    WScript.Sleep intPause
    
    objShell.Run "%comspec% /c ping -n " & strPings & " -w 100 " & _
        strTarget & ">>" & strTempFile, 0, True
    
    Set objTempFile = objFSO.OpenTextFile(strTempFile, ForReading)
    strOutput = objTempFile.ReadAll
    objTempFile.Close
    objFSO.DeleteFile strTempFile, True
 
    If InStr(strOutput, "bytes=32") > 0 Then
        PingCheck = True
    Else
        PingCheck = False
    End If
End Function

Open in new window

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question