Skip to main content
Solved

Is there a trick to getting EAs to work?

  • January 22, 2019
  • 5 replies
  • 18 views

Forum|alt.badge.img+9

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.

Best answer by thetfordb

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

5 replies

Forum|alt.badge.img+9
  • Author
  • Contributor
  • January 22, 2019

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


Forum|alt.badge.img+8
  • Contributor
  • Answer
  • January 22, 2019

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


Forum|alt.badge.img+9
  • Author
  • Contributor
  • January 22, 2019

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?


Forum|alt.badge.img+14
  • Honored Contributor
  • January 22, 2019

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


Forum|alt.badge.img+9
  • Author
  • Contributor
  • January 22, 2019

Thanks jtrant!