File Count Script

This script checks the number of files in a directory. Specify the path as the script argument. The statistic is the number of files in the directory.




Windows credentials valid on both the SAM and target server.

Component monitors

To learn more about default component monitors included in SAM, see SAM online help.

File Count

This component monitor counts the number of files in a directory, optionally including its subdirectories. Files that do not match the file extension or file attribute type are ignored.

This monitor may fail if you attempt to count more than 20,000 files in a directory using the wildcard * filter extension. To get an accurate count of the files in such large directories, you must instead create a Windows Script monitor that runs the File Count script located in the script examples folder C:\Program Files (x86)\SolarWinds\Orion\APM\SampleScriptMonitors\WindowsScripts.