→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bkemp
Engaged Sweeper
I would like to create a report to view the OST file size for users on computers.
the ost is located C:\Users\bkemp\AppData\Local\Microsoft\Outlook
2 REPLIES 2
KrisNelson
Champion Sweeper
Since there are variables in the file path\name that Lansweeper can't compensate for you would need to have a log in script check it and write them to registry keys and then scan those.

Here's a sample script.

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject( "WScript.Shell" )
appDataLocation=objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%")
objStartFolder = appDataLocation + "\microsoft\outlook\"

Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files

For Each objFile in colFiles
If Right(objFile.Name, 4) = ".ost" Then
wshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\CompanyName\OST\FileName", objFile.Name, "REG_SZ"
wshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\CompanyName\OST\FileSize", objFile.Size, "REG_SZ"
End If
Next
francisswest
Champion Sweeper
bkemp@boonecountymo.org wrote:
I would like to create a report to view the OST file size for users on computers.
the ost is located C:\Users\bkemp\AppData\Local\Microsoft\Outlook


I would love to see this as well. Obviously we would want to use the currently logged on, or last logged on user rather than a specific "bkemp" so we could get a report of dangerously large ost files that are actively in use. Maybe even a "last modified on" date scan of all .ost files?