Powershell Monitor - Check Files of File Type Created Within Look-back Period

Version 1

    The attached powershell script can be used in SAM to count files in a directory of a defined type over a defined look-back period. I use this to make sure that files are being deposited into one of our business communications apps where I am expecting to see a file at least once a day.

     

    On the template setting, I had to check "Run the script under specified account:" as true for this monitor to work.

     

    The parameters are [path,file extension,period in hours]. E.g.  [\\${IP}\c$\SFTP\OrionDrop\,zip,25] will count the number of zip files in UNC path \\${IP}\c$\SFTP\OrionDrop\ that have been created within the last 25 hours.