
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2013 05:15 PM
Is it possible to make a report or setup scans to get PSTfile locations and counts from all PC's ?
Solved! Go to Solution.
Labels:
- Labels:
-
Archive
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2013 09:51 PM
You must submit a specific file path for file scanning. It is not currently possible to search an entire computer for a specific file or perform extension based scanning for instance.
The reason this has not been implemented is because these kinds of scans are extremely taxing on client computers and take too long to complete.
The reason this has not been implemented is because these kinds of scans are extremely taxing on client computers and take too long to complete.
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2013 12:43 PM
@chads
You can make this with a script. i made it with .VBS. save the code to .vbs file and then run it from command line. You have to run the script with account that has admin permissions to scanned computers.
tips:
variable arrComputers is an Array with computer names (ex. arrComputers = array("pc1","pc2") )
variable fldr is for FolderShare where i store the reports
if you change a little bit the script, it can be used as a custom action in Lansweeper Console.
---------------------------
'Multiple computers .pst file search and report them in Owner folder
' isOpen - check if NotScanned.txt file is created
' isAlive - check if remote computer is turned on
On Error Resume Next
isOpen=0
isAlive=0
arrComputers = Array("WRITE_COMPUTER_NAMES HERE")
strLocalComputer = "."
for i = 0 to UBound(arrComputers)-1
Set objWMIService = GetObject(_
"winmgmts:\\" & strLocalComputer & "\root\cimv2")
if i mod 2 = 0 Then
strComputer = arrComputers(i)
Set colPings = objWMIService.ExecQuery _
("Select * From Win32_PingStatus where Address = '" & strComputer & "'")
For Each objStatus in colPings
If IsNull(objStatus.StatusCode)or objStatus.StatusCode<>0 Then
isAlive = 0
Else
isAlive = 1
End If
Next
If isAlive = 1 Then
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_DataFile Where Extension = 'pst'")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If colFiles.Count > 0 Then
For Each objFile in colFiles
fullFilePath = objFile.Drive & objFile.Path & objFile.FileName & "." & objFile.Extension
folderName = arrComputers(i+1)
fldr="\\NAS1\Outlook archives\" & folderName
'Wscript.Echo fldr
If not objFSO.FolderExists(fldr) Then
set objFolder = objFSO.CreateFolder("\\NAS1\Outlook archives\" & folderName)
End If
Set objTextFile = objFSO.CreateTextFile("\\NAS1\Outlook archives\" & folderName & "\" & strComputer & ".txt",2)
objTextFile.Write(strComputer & ",")
objTextFile.Write(objFile.Drive & objFile.Path & ",")
objTextFile.Write(objFile.FileName & "." & objFile.Extension & ",")
objTextFile.Write "Size: " & Round(objFile.FileSize/1024) & "KB" & vbCrLf
Next
objTextFile.Close
Else
If isOpen= 0 Then
set objNotScanned = objFSO.CreateTextFile("\\NAS1\Outlook archives\NotScanned.txt",2)
isOpen=1
else
set objNotScanned = objFSO.OpenTextFile("\\NAS1\Outlook archives\NotScanned.txt",8)
End If
objNotScanned.WriteLine(strComputer)
objNotScanned.Close
End If
else
If isOpen= 0 Then
set objNotScanned = objFSO.CreateTextFile("\\NAS1\Outlook archives\NotScanned.txt",2)
isOpen=1
else
set objNotScanned = objFSO.OpenTextFile("\\NAS1\Outlook archives\NotScanned.txt",8)
End If
objNotScanned.WriteLine(strComputer)
objNotScanned.WriteLine(arrComputers(i+1))
objNotScanned.Close
End If
Wscript.Echo strComputer
Wscript.Echo "-------------"
end If
Next
You can make this with a script. i made it with .VBS. save the code to .vbs file and then run it from command line. You have to run the script with account that has admin permissions to scanned computers.
tips:
variable arrComputers is an Array with computer names (ex. arrComputers = array("pc1","pc2") )
variable fldr is for FolderShare where i store the reports
if you change a little bit the script, it can be used as a custom action in Lansweeper Console.
---------------------------
'Multiple computers .pst file search and report them in Owner folder
' isOpen - check if NotScanned.txt file is created
' isAlive - check if remote computer is turned on
On Error Resume Next
isOpen=0
isAlive=0
arrComputers = Array("WRITE_COMPUTER_NAMES HERE")
strLocalComputer = "."
for i = 0 to UBound(arrComputers)-1
Set objWMIService = GetObject(_
"winmgmts:\\" & strLocalComputer & "\root\cimv2")
if i mod 2 = 0 Then
strComputer = arrComputers(i)
Set colPings = objWMIService.ExecQuery _
("Select * From Win32_PingStatus where Address = '" & strComputer & "'")
For Each objStatus in colPings
If IsNull(objStatus.StatusCode)or objStatus.StatusCode<>0 Then
isAlive = 0
Else
isAlive = 1
End If
Next
If isAlive = 1 Then
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_DataFile Where Extension = 'pst'")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If colFiles.Count > 0 Then
For Each objFile in colFiles
fullFilePath = objFile.Drive & objFile.Path & objFile.FileName & "." & objFile.Extension
folderName = arrComputers(i+1)
fldr="\\NAS1\Outlook archives\" & folderName
'Wscript.Echo fldr
If not objFSO.FolderExists(fldr) Then
set objFolder = objFSO.CreateFolder("\\NAS1\Outlook archives\" & folderName)
End If
Set objTextFile = objFSO.CreateTextFile("\\NAS1\Outlook archives\" & folderName & "\" & strComputer & ".txt",2)
objTextFile.Write(strComputer & ",")
objTextFile.Write(objFile.Drive & objFile.Path & ",")
objTextFile.Write(objFile.FileName & "." & objFile.Extension & ",")
objTextFile.Write "Size: " & Round(objFile.FileSize/1024) & "KB" & vbCrLf
Next
objTextFile.Close
Else
If isOpen= 0 Then
set objNotScanned = objFSO.CreateTextFile("\\NAS1\Outlook archives\NotScanned.txt",2)
isOpen=1
else
set objNotScanned = objFSO.OpenTextFile("\\NAS1\Outlook archives\NotScanned.txt",8)
End If
objNotScanned.WriteLine(strComputer)
objNotScanned.Close
End If
else
If isOpen= 0 Then
set objNotScanned = objFSO.CreateTextFile("\\NAS1\Outlook archives\NotScanned.txt",2)
isOpen=1
else
set objNotScanned = objFSO.OpenTextFile("\\NAS1\Outlook archives\NotScanned.txt",8)
End If
objNotScanned.WriteLine(strComputer)
objNotScanned.WriteLine(arrComputers(i+1))
objNotScanned.Close
End If
Wscript.Echo strComputer
Wscript.Echo "-------------"
end If
Next

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2013 09:51 PM
You must submit a specific file path for file scanning. It is not currently possible to search an entire computer for a specific file or perform extension based scanning for instance.
The reason this has not been implemented is because these kinds of scans are extremely taxing on client computers and take too long to complete.
The reason this has not been implemented is because these kinds of scans are extremely taxing on client computers and take too long to complete.
