File Age Monitor (Wildcard)

File Age Monitor (Wildcard)

This allows you to check the age of a specific file type and define how many minutes old a file can be.

There are three variables that can be defines in the 'Script Argument'

  • Path: This is the full path to the file or folder.
    • Examples of file path:
      • C:\temp\*.txt
      • D:\application\*.xml
  • Time: in minutes. Default minute parameter is set to 60 in the SAM template.
  • Recursive: If pointed to a folder setting this to $true will also check all sub-directories.


Thanks for the help with correcting the file count vinx​ ​


    Can this be used to monitor a share?  I'm not sure what I'm doing wrong, but I can confirm the credentials can see the files in Windows Explorer from the poller, but the check comes back with 0 files found.


    I have a couple of comments. In order to get the script to work with suggested credentials I had to set the setting below:


    I also could not get the arguments to be accepted from Scripts Argument field. I had to hard-code in script's body. I would appreciate some clarification as to why that would fail

  • , You'd either have to use the agent (easiest way to do it) or you have to setup WinRM on that remote server. If you do the latter, you can update the component monitor to use 'Remote Host' and fill in the WinRM info.

    2020-11-18 08_43_38-Edit Application Template - Exchange 2010 OWA Form Login (PowerShell).png


    I'm getting following message back when I test:

    Output: ==============================================
    Statistic: 0
    Message: 0 files found older than 20 minutes:

    Errors: ==============================================
    Get-ChildItem : Cannot find path '(FOLDER THAT DOES EXIST)' because it does not exist.
    At line:27 char:20
    + $FileArray = $(Get-ChildItem $path | Where-Object { !$_.PSIsConta ...
    + ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (C:\cabelas\sap\export\orders:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

    Does this require an agent to work?  We don't have agents on our servers, so is there something I can do with the template to get it to work?  

  • So the script should use the Orion Agent when executing the script. That agent runs under the 'LOCAL SYSTEM' account. Perhaps try changing that service to run-as something else or update the application directory permissions to allow local system and see what you get.

    If the Orion Agent is not installed on that remote node, then the script only executes locally on the Orion Server. You want to switch polling method to agent and test again.