CODE WRITTEN BY QUEST KACE SUPPORT FOR DEMONSTRATION PURPOSES ONLY AND NOT SUPPORTED BY KACE TECHNICAL SUPPORT. CLIENT CONFIRMS THE NEED FOR TESTING AND ACCEPTS ALL RESPONSIBILITY FOR USE AND MISUSE OF CODE. QUEST KACE SHALL NOT BE HELD LIABLE FOR DAMAGE OR DOWN TIME RESULTING FROM USE OF THIS OR ANY CODE PRESENTED FOR PURPOSES OF TROUBLESHOOTING OR DEMONSTRATION. For customization of the KACE Systems Management Appliance, please contact our Professional Services Organization
The following example is for retrieving the 'Modified Date' value of a file in the 'Public Desktop' folder.
To create a Custom Inventory Rule navigate to Inventory | Software | Choose Action | New
1. Give your Inventory rule a meaningful name. For example: "CIR - Retrieve modified date file information"
2. Select target Operating System: depending on the target devices, you can determine the target OS for your rule. For this example we will be using All Windows.
3. Type the command/instructions for your custom inventory rule. For details on the syntax for KACE SMA custom inventory rules please click on the question mark icon next to "Custom Inventory Rule" label.
4. The inventory rule would look as follows: FileInfoReturn(%Public%\Desktop\test.txt, ModifiedDate, DATE) where "test.txt" is the filename with its extension.

5.
The results will show on the Device Inventory under Software | Custom Inventory Fields

*******************
The following example is to see which devices have "X" file that has a modified date value of "Y". The file is in the 'Public Desktop' folder.
To create a Custom Inventory Rule navigate to Inventory | Software | Choose Action | New
1. Give your Inventory rule a meaningful name. For example: "CIR - Devices with X file that has a modified date value of Y"
2. Select target Operating System: depending on the target devices, you can determine the target OS for your rule. For this example we will be using All Windows.
3. Type the command/instructions for your custom inventory rule. For details on the syntax for KACE SMA custom inventory rules please click on the question mark icon next to "Custom Inventory Rule" label.
4. The inventory rule would look as follows: FileInfoEquals(%Public%\Desktop\test.txt, ModifiedDate, DATE, 03/21/2023 09:40:37) where "test.txt" is the filename with its extension and "03/21/2023 09:40:37" is the modified date value as seen on the file (See previous CIR example)

5. Since this custom inventory rule is only to see which devices have "X" file with a modified date value of "Y", the result will not appear in
Device Inventory under Software | Custom Inventory Fields. The devices will be listed on the CIR itself.
