Showing results for 
Search instead for 
Did you mean: 
Create Post

Folder Statistics

This template generates a number of statistics on specified folder for both stats and alerting. Simply apply to a node and enter the folder path in 'script arguments' field to get:


Folder Last Modified Time Stamp

File Count

Sub Folder Count

Total Size

File with oldest edit date

File with latest edit date

Labels (1)

Thank you very much! I need to plug it in and I will certainly provide feedback and rating!!

Thanks for sharing this. I am going to give this a try now actually. I have a folder where files are dropped by one app, then picked up by another and processed. If the process is successful the folder will remain empty. The filenames change so that makes it a little challenging. I think your monitor may fit the bill. Thanks agian.

Yes this monitor should fit your requirement, just set the warning/critical threshold to anything over '1' for 2 polls and you could use the 'file with latest edit date' component too to list what the file is that has been found. 

Hello Osborne,

Can i ask you if we can also use this to monitor time stamp of newly created folders in a location? This is my requirement trigger alert if any new folder is created in a location (inside a folder). Basically monitor folder creation,the moment new folder is created need to trigger a alert.

Can i use your template for it?We will not be monitoring the same folder or file.



Yes, there is a statistic for folder count and another for file count which are a recursion within the supplied path so for example if you were using this to monitor c:\temp you would get a count on every poll of all sub folders and all sub files so you could create a threshold of 'greater than' '0' under 'foldercount' to flag a warning/critical state or build an alert to watch the count. You can also build charts to display over time such as I use for a similar requirement:


Hi Osborne,

Thanks for info. This mean this is to monitor activities for a static folder . But my case if to trigger alert when a new folder gets created in a specified location, which seems not possible with it.



It will do as you require. If you wanted to alert if any folder is created anywhere on a c: just specify C: as the folder to monitor then tick 'count statistic as difference' under foldercount. The first poll will calculate the current total folders then from then on the count should equal zero so just set an alert to be raised if the count is higher than zero. Presumably though you will have some idea where the folder may be created so just use the top level parent as the folder to monitor.


Thank you for updating the result. I am looking the syntex folder share patch which is used script arguments' field.

Could you please post the screenshot of script arguments' field.

Script arguments is simply the local path on the host where the monitor is assigned:


Is this what you was after?

ND Not Defined

Does the script work on the local machine if you copy it into the ISE?

Have you tested WinRM config is working on the target from the poller?

Hi, osborne_graham​.

i found this template very useful, but unfortunately i can't make template works properly. when i test it using the C: drive im not getting any problem but when tested on other drive im getting Not Found. WinRM is working and tested locally on the server script is running perfect which ever drive.


Sorry, just saw your post now. From your screenshot it looks like it should be OK. Does it work if you use just the root of D:\ as the arg?

no worries ,  same result using the root of D:\.

Add the following above the 'exit 0' line in the script and perform a test run on your chosen machine:

Write-Host 'Message.Debug:'  $env:COMPUTERNAME

Write-Host 'Statistic.Debug: ' 0

It will output the name of the machine its looking at. My theory is that you may be running it in local host execution mode and if thats the case you'll see the name of your poller. If this is the case make sure you are running in remote host execution mode.

All working now. your theory is correct . Thank you very much for the template and help...


Thank you! I was looking for something like this and this was the first thing that popped up.  

@osborne_graham - thanks for this wonderful and helpful template.  Would it be possible to modify the script to let me know when a file has been in the folder for longer than 4 hours?  I am not script savvy enough to understand what I would need to modify.



@dhaldeman ,  I've updated the template to return the oldest and latest file age in minutes rather than timestamp. Download the template again and just set the warning or critical field to greater than 240:



Thank you.  I believe that this is going to provide me with the information I need.  I appreciate your quick response.




I just received a request to monitor a folder for files that begin with specific naming convention, EmptyFillerOrder.  I have looked in the community and did not find anything that would fit the bill.  Would you happen to know if there is a template or of a way to monitor file names?  I am hoping that it would be something as simple as a variable such as "EmptyFillerOrder_*.pdf".



@dhaldeman yes, I've done a few monitors that have dynamically named files so I should be able to add something to this template for you but can you please detail exactly in what way you want to monitor these files. Do you need a count or monitor only the latest version of these files or some other requirement?



I will need a count of files that start with "EmptyFillerOrderNumber_".  There are multiple files (PDF's) in the folder but sometimes when something did not process correctly it begins with the "EmptyFiller" naming scheme.  I just need to be alerted when a file that starts with that name shows up in the folder.



Is this compatible with DFS file share or any windows \\UNCPath can be monitored?

Version history
Revision #:
2 of 2
Last update:
‎05-30-2020 02:57 AM
Updated by: