Skip to main content

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.

Code isn't display right....



!/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



There is a hash infront of !/bin/sh


don't believe EAs run at policy check. You need to run a full inventory (sudo jamf recon)


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?


Create a policy that runs daily on the target machine group (or 'All Computers') with the "Update Inventory" maintenance task selected.


Thanks jtrant!