Top 5 Largest Files Per Volume

Details

Summary

Neeed to find the five largest files per scan target and their owners for both eDirectory and Active Directory.

The largest file count can be changed by changing the value in row 17.

Code
 WITH
    x(identity_system, scan_target, fullpath, size, size_string, path_type, rownum) AS (SELECT sd.identity_system,
          sd.scan_target,
          sd.fullpath,
          sd.size,
          srs.byte_string(sd.size) AS size_string,
          sd.path_type,
          Row_Number() OVER (PARTITION BY sd.scan_target ORDER BY sd.size DESC, sd.fullpath_hash) AS rownum
        FROM srs.active_fs_scandata AS sd
        WHERE sd.path_type = 1)
SELECT
    *,
    srs.byte_string(CAST(Sum(x.size) OVER (PARTITION BY x.scan_target) AS BIGINT)) AS target_total_string
FROM
    x
WHERE
    x.rownum <= 5 
 
Author
richierich
Last modified
Thursday, May 7, 2015 - 14:32
Properties
Minimum Version
Report Category
Includes a Report Layout
Yes
Databases
Rating
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1
Downloads
AttachmentSize
5 Largest Files Per Volume.zip2.59 KB
Sample Report
AttachmentSize
5 Largest Files Per Volume.pdf56.31 KB
Preview Images