Posted on 01-22-2019 11:01 AM
I am just getting started with EAs for computers, and I have one that I want to use, it is the following script;
**#!/bin/sh
fmmToken=$(/usr/sbin/nvram -x -p | /usr/bin/grep fmm-mobileme-token-FMM)
if [ -z "$fmmToken" ];
then echo "<result>Disabled</result>"
else echo "<result>Enabled</result>"
fi**
I have the EA setup as follows;
Data type: String
Inventory Display: General
Input type: Script
And the above in the script field.
I see it in the General area of the computer details, but nothing ever populates, the device is checking in every 15 minutes, but I can't see anything in the logs about this EA.
What am I missing here? If I run this as a script in Self Service, I see the output so I am confident that the code is good.
Solved! Go to Solution.
Posted on 01-22-2019 11:03 AM
don't believe EAs run at policy check. You need to run a full inventory (sudo jamf recon)
Posted on 01-22-2019 11:02 AM
Code isn't display right....
fmmToken=$(/usr/sbin/nvram -x -p | /usr/bin/grep fmm-mobileme-token-FMM)
if [ -z "$fmmToken" ];
then echo "<result>Disabled</result>"
else echo "<result>Enabled</result>"
fi
There is a hash infront of !/bin/sh
Posted on 01-22-2019 11:03 AM
don't believe EAs run at policy check. You need to run a full inventory (sudo jamf recon)
Posted on 01-22-2019 11:05 AM
You are correct, I just did the full inventory and I see the information populated.
Is there a way to have this run automatically every day?
Posted on 01-22-2019 11:14 AM
Create a policy that runs daily on the target machine group (or 'All Computers') with the "Update Inventory" maintenance task selected.
Posted on 01-22-2019 11:48 AM
Thanks jtrant!