Smart Group to Compare Attributes

HNTIT
Contributor II

We have an Extension attribute that is manually set in JAMF to give a desrired Target value for each machine.

A Smart Group checks if the value has been set, and if it has a Policy runs a script. The script checks if the proper value and the Target Value match on the local machine and if not it makes the change.

What I need now is a smart group that will populate if the Standard JAMF Value and the Extension Attribute match, then I can use this group to Exclude from the Policy, otherwise the policy and script run every check in and it just bloats the logs and makes things hard to spot.

Any Thoughts ?

2 REPLIES 2

mm2270
Legendary Contributor III

Question - Are the Standard value and the EA value variable per machine, or will they always be the same across all systems? If they are the same across all machines, I assume you could do something like:

Standard Jamf Value | is | <desiredvalue>
and
Extension Attribute Value | is | <desiredvalue>

That would give you a group where the 2 values are what you expect.

If they are variable and not the same across machines, then the only way I can think of to do that is to create another EA script that uses the Jamf API to grab the 2 values from the machine record and compare them, and output a response like "Match" or "No Match" or something to that effect. Then you could use that to build another Smart Group where the new EA value is "Match"

HNTIT
Contributor II

Yes they are variables

Didnt know you could safely use the API for an Ext Attribute as the Script would need the Username and Password of a JAMF user in plain text in the script.

Would have thought that unwise.

Perhaps the script that does the change will have to make a second check to ensure the job is done and write something to a file that the Extension Attribute can check.

Was hoping to avoid that, but if I must I must