Extension Attribute to check file modified date

_aDiedericks
Contributor

Hi there, is there a way to get an extension attribute in Jamf to report a target file's last modified date?

1 ACCEPTED SOLUTION

You need to wrap the output for all extension attributes with <result> & </result>

So your last command should be:  echo "<result>$datemodified</result>"

View solution in original post

4 REPLIES 4

DTB_Kirky
New Contributor III

Use stat -x
eg: stat -x /Applications/Box.app | grep "Modify" | awk '{print $2,$3,$4,$5,$6}'

Appears to be working when ran from terminal or from script/policy in Jamf but as an extension attribute it doesn't collect any data.

Screenshot 2024-05-11 at 02.59.22.png

You need to wrap the output for all extension attributes with <result> & </result>

So your last command should be:  echo "<result>$datemodified</result>"

Thank, that seemed to be the icing on the cake

Screenshot 2024-05-13 at 09.58.43.pngScreenshot 2024-05-13 at 09.59.00.png