Get Outlook PST size and location

I need a quick Analyses that will pull back the Outlook PST file size and location. Basically, files that end in .PST any help would be great, I need this asap for a meeting.

Thanks.

Sno

I’d create a task to run a powershell script to perform the search and output the locations to a text file. Then create an analyses to read the results from the text file and return the information you need.

Task:
delete __createfile
delete c:\windows\temp\pst_search.ps1
delete c:\windows\temp\PST\pst_locations.txt

waithidden cmd /C mkdir “c:\windows\temp\PST”

createfile until EOF
$drives = Get-WmiObject win32_volume | ? {{$.DriveType -eq 3} | % {{Get-PSDrive $.DriveLetter[0]}
foreach ($drive in $drives){{
$path = $drive.root + "*.pst"
cmd.exe /C dir /s /b /a /o:gn $path | out-file -append -filepath c:\windows\temp\PST\pst_locations.txt -encoding ASCII
}

EOF

copy __createfile c:\windows\temp\pst_search.ps1

runhidden cmd /K powershell.exe -ExecutionPolicy Bypass c:\windows\temp\pst_search.ps1

Analyses:
((pathnames of it, size of it, modification time of it as string) of files (substrings separated by “%0d%0a” of (concatenation “%0d%0a” of lines of file “C:\Windows\Temp\PST\pst_locations.txt”)))

2 Likes

A search on the forum for PST size also gives a similar approach.