You can use custom attributes to unlock product provisioning's more advanced functionality for your macOS device. Write a command or script and report it as a custom attribute using the Workspace ONE Intelligent Hub for macOS v.2.3 or later. Select when to run the command or script on hourly intervals or during an event.

Custom Attributes can also be used in Assignment Rules for Products.

Procedure

  1. Navigate to Resources > Profiles & Baselines > Profiles and select Add > Add Profile. Select Apple macOS, and then select Device Profile, because this profile is only applicable to the device, not the user.
  2. In the left panel, select the Custom Attributes profile and select the Configure button.
  3. Enter the Attribute Name.
  4. Enter the Script/Command to run. Expand the text box as needed.
  5. Select an Execution Interval and allow for scheduling to report either in hours or as an event occurs.
  6. Use the + and - buttons at the bottom of the payload to create multiple scripts.
  7. Select Save & Publish when you are finished to push the profile to devices.
    Note: Custom Attribute values cannot return the following special characters: / \ " * : ; < > ? |. If a script returns a value which contains these characters, the value is not reported on the console. Trim these characters from the script's output.

Results

The script included in the profile runs on the device to gather the values for each attribute.

Example: Key-value Pair Examples

The following is an example of commands you can use for creating, removing, or modifying key-value pairs. Use these commands to dynamically change the values for a custom attribute on the device.

Add a Key-Value Pair.

/usr/libexec/PlistBuddy -c "Add :ASSET_ID string '1'" "/Library/Application Support/AirWatch/Data/CustomAttributes /CustomAttributes.plist"

Delete a Key-Value Pair.

/usr/libexec/PlistBuddy -c "Delete :ASSET_TAG" "/Library/Application Support/AirWatch/Data/CustomAttributes/ CustomAttributes.plist"

Modify a Key-Value Pair.

/usr/libexec/PlistBuddy -c "Set :ASSET_ID '2'" "/Library/Application Support/AirWatch/Data/CustomAttributes/ CustomAttributes.plist"

What to do next

You can view existing custom attributes for all devices at a particular organization group and manually create custom attributes directly in the console.

Navigate to Devices > Provisioning > Custom Attributes > List View. Any custom attribute created in this manner automatically associates with a device and its respective custom attribute value that transmits successfully to the console.