The sample scripts are not supported under any N-able support program or service. The sample scripts are provided AS IS without warranty of any kind, and N-able expressly disclaims all implied warranties including, warranties of merchantability or of fitness for a particular purpose. In no event shall N-able or any other party be liable for damages arising out of the use of or inability to use the sample scripts.

Monitor Most Recent File in Folder for Age - RMM

Last Modified Date

2/17/2021 7:02 PM

Description

This was built during the January 2021 Automation Office Hours.It is a script check for RMM (a version exists for N-Central and can be found in the Automation Cookbook). 


The purpose of the script is to look in a selected folder and look for the age of the most recent file.

Type

Custom Service / Script Check

Category

Windows File System

Target OS

Windows 8/8.1;Windows 10;Windows Server 2012 / 2012R2;Windows Server 2016;Windows Server 2019

Compatible with N-Central

No

N-Central minimum version

Compatible with RMM

Yes

Syntax

To use this, import it via script manager, and add as a script check on the desired device. When adding it to the device, it will ask for the folder path, and the maximum hours on the file. 
The script check will run and find the most recent file, and will return a pass status if the file is more recent than the threshold, or fail status if it is over that threshold.

Note that if the folder does not exist, it will also return a failed state

Output

The policy does note return any usable output

Keywords

Related Content