Computer Extension Attributes
Extension attributes allow you to collect extra inventory information. Extension attribute values are populated using an input type, which can be any of the following:
Text field
Pop-up menu
Script
LDAP attribute mapping
In Jamf Pro, you can create extension attributes manually or from an available template in Jamf Pro. You can also create extension attributes programmatically via the Jamf Pro API. For more information, see Extension Attributes in the Jamf Pro Developer Portal.
Examples:
A text field input can collect the retire date of a computer.
A script input can collect data about your company's antivirus software on a computer.
Extension attributes can be used as criteria in a smart group or as a variable in a configuration profile, which allows you to administer dynamic management workflows and tasks based on the data collected with extension attributes.
Depending on the input type and data type (string, integer, date), extension attributes may add time and network traffic to the inventory collection process.
Extension Attribute Input Types
Extension attributes collect inventory data by using an input type. You can configure the following input types:
- Text Fields
- You can display a text field in inventory information or Recon to collect inventory data. You can enter a value in the field during enrollment with Recon or anytime using Jamf Pro.Note:
Text fields can only be configured by a manually created extension attribute or programmatically via the Jamf Pro API.
- Pop-up Menus
- You can display a pop-up menu in inventory information or Recon to collect inventory data. You can choose a value from the pop-up menu when enrolling a computer using Recon or any time using Jamf Pro.Note:
Pop-up menus can only be configured by a manually created extension attribute or programmatically via the Jam Pro API.
- Scripts
You can run a script that returns a data value each time a computer submits inventory to Jamf Pro. You can write your own extension attribute script or create one from a template in Jamf Pro.
Keep the following in mind when writing extension attribute scripts:Scripts can be written in any language that has an interpreter installed. The most common interpreters are Bash, Perl, and Python.
When an extension attribute is populated by a script, the text between the
<result></result>
tag is stored in Jamf Pro.You can temporarily disable extension attributes to troubleshoot processes.
The following example script collects the hostname from Mac computers:#!/bin/bash echo "<result>`hostname 2>&1`</result>"
- LDAP Attribute Mapping
You can use an LDAP attribute mapping to populate an extension attribute. Extension attributes can be populated by multiple-value attributes from an LDAP server, such as "memberOf". The multiple values can later be used when creating smart groups and advanced searches with the extension attribute criteria and the "has" or "does not have" operators.
Keep the following limitations in mind when using LDAP multiple-value extension attributes:When creating smart groups and advanced searches, the criteria value must accurately reflect the value returned in inventory. To ensure you use the correct value, copy the extension attribute inventory value, and paste it in the criteria value field.
Multiple-value attribute mapping will not work with nested groups. Only the groups directly listed on the User record will be displayed in the mapped LDAP extension attribute.
For the extension attributes to work correctly, values returned from the LDAP server cannot contain the sequence of repeating vertical-bar characters (ASCII code 124, HTML entity = |).
Extension Attribute IDs and Variables
Creating a computer extension attribute generates a variable that can be used to populate configuration profile settings. The variable is $EXTENSIONATTRIBUTE_#
, where #
is the extension attribute ID.
For information about using payload variables for configuration profiles, see Computer Configuration Profiles.
For extension attributes that use a text field, pop-up menu, or script input type, the ID number is found in the extension attribute URL. In the example URL below, "id=2" indicates the extension attribute ID number:
https://JAMF_PRO_URL.jamfcloud.com/computerExtensionAttributes.html?id=2&o=r
For extension attributes with the LDAP attribute mapping input type, the ID number is displayed in the LDAP Attribute Variable field after you save the extension attribute.
Manually Creating a Computer Extension Attribute
If you are creating a computer extension attribute with the “LDAP Attribute Mapping” input type, you need the following:
-
An LDAP server configured in Jamf Pro (For more information, see LDAP Directory Service Integration.)
-
The Computer Inventory Collection settings configured to collect user and location information from LDAP (For more information, see Computer Inventory Collection Settings.)
- In Jamf Pro, click Settings
in the top-right corner of the page.
- In the Computer Management–Management Framework section, click Extension Attributes
.
- Click New
.
- Configure the following settings:
- Name your extension attribute.
- (Optional) Enter a description.
- Choose the type of data being collected from the Data Type pop-up menu.
- Choose a category in which to display the extension attribute in Jamf Pro from the Inventory Display pop-up menu.
- Choose an input type to populate your extension attribute from the Input Type pop-up menu.
- Click Save
.
Creating a Computer Extension Attribute from a Template
Jamf Pro has built-in templates for many commonly used extension attributes.
- In Jamf Pro, click Settings
in the top-right corner of the page.
- In the Computer Management–Management Framework section, click Extension Attributes
.
- Click New From Template.
- Click the extension attribute template you want to use.
- (Optional) Make changes to the settings as needed.
- Click Save
.
Disabling a Computer Extension Attribute
To troubleshoot workflows, you can temporarily disable extension attributes with the script input type. You can also choose whether to retain or delete data collected by that extension attribute.