Updated 29-Mar-11: Search for files matching any combination of name, size & age criteria

0 Likes
over 10 years ago

Custom Knowledge script which searches folders for files matching any combination of name, size and age criteria



  • Raise an event if the number of files found breaches a threshold

  • All numeric thresholds may be based on any mathematical comparison i.e. >, >=, =, <=, <, <>

  • Age may be determined based on create date or last modified date

  • Optionally monitor sub-folders and raise a separate event for each sub-folder

  • Optionally collect data for the number of files in each monitored folder


Update 29-Mar-2011



  • Handle files being deleted during KS execution

  • Fix bug in which the file count is cumulative across iterations of the Job. Reset the count each iteration.



NetIQ does not test or validate any software, code or other materials provided in, on or through NetIQ Cool Solutions (collectively, "Materials"), so please use caution when downloading or accessing any Materials from Cool Solutions and ensure that you have reasonable and current security, spyware and anti-virus measures in place on your computer and/or network prior to downloading. Additionally, do not use any Materials downloaded from Cool Solutions in any production environment without first testing the Materials to ensure they are compatible with your version of NetIQ software or any other hardware or software present in your network or environment. Cool Solutions is not a substitute for authorized NetIQ support and should not be used as such. NETIQ COOL SOLUTIONS AND ANY MATERIALS ARE PROVIDED ON AN AS-IS, AS-AVAILABLE BASIS WITHOUT ANY WARRANTY OF ANY KIND. By downloading this file, you are agreeing to these terms of use. To report a problem please contact: coolguys-netiq@netiq.com. Your use of Cool Solutions is governed by the Cool Solutions Terms and Conditions. https://www.netiq.com/communities/coolsolutions/terms-and-conditions/

Labels:

How To-Best Practice
Comment List
Anonymous
  • Mate, I like this :-)

    I changed the match file array to reset itself per each folder enumeration as apposed to accumulating file match.

    'Check each folder for matching files and raise alert as appropraite
    For i = 0 To UBound(arrAllFolders)
    ‘****** Here ****
    ReDim arrFiles(-1)
    ‘*****
    FindMatchingFiles arrAllFolders(i), arrFiles
    ProcessResult arrAllFolders(i), arrFiles
    Next
Related Discussions
Recommended