> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Global Variables

> Use global variables in Iru Endpoint custom scripts and profiles to dynamically insert device-specific values like serial number, user email, and hostname.

<Callout icon="list-check" color="#B84A7A" iconType="regular">Global variables work for all device types</Callout>

### What are Global Variables?

Global variables (or environment variables) are dynamic values that influence how processes and applications behave. These variables store essential information like system paths, user details, and configuration settings, which can be accessed and used by various programs and scripts. Iru's global variables feature lets you automatically input unique device details into most profile text fields within profiles—including [Custom Profiles](/en/endpoint/library/library-items-profiles/custom-profiles-overview) and other Library Items—or [App Config](/en/endpoint/library/library-items-profiles/using-appconfig).

### How to Use Global Variables in Iru Endpoint

Global variables can be used inside most text fields within Profiles (Custom Profiles or Library Items) and the **Provision Local Administrator Account** section's Full Name and Short Name fields in the [Automated Device Enrollment Library](/en/endpoint/settings/apple-integrations/configure-automated-device-enrollment) item. Global variables work for all device types. Variables can also be used multiple times in the same field.

<Note>
  If a device variable that is used on a profile is updated, that profile will be re-installed on the device with the updated variable.
</Note>

<Tip>
  For use in custom scripts, we have examples of a [Custom Profile](https://github.com/kandji-inc/support/blob/main/Global%20Variables/Global%20Variables.mobileconfig) that populates those values locally, and a [Custom Script](https://github.com/kandji-inc/support/blob/main/Global%20Variables/GlobalVariablesExample.sh) which reads those values back into the web app on our [GitHub repo](https://github.com/kandji-inc/support).
</Tip>

<Warning>
  Ensure that you do not use the Zsh shell when referencing these variables in scripts as some variables will not render correctly.
</Warning>

### Available Global Variables

<AccordionGroup>
  <Accordion title="All Device Families">
    | Variable            | Description                                                                                        |
    | ------------------- | -------------------------------------------------------------------------------------------------- |
    | `$SERIAL_NUMBER`    | Inserts the **Serial Number** of the device the profile installs on.                               |
    | `$DEVICE_NAME`      | Inserts the **Device Name** of the device the profile installs on.                                 |
    | `$ASSET_TAG`        | Inserts the **Asset Tag** of the device the profile installs on.                                   |
    | `$DEVICE_ID`        | Inserts the **Device ID** of the device the profile installs on.                                   |
    | `$UDID`             | Inserts the **Unique Device Identifier** of the device the profile installs on.                    |
    | `$PROFILE_UUID`     | Inserts the **Universally Unique Identifier** of the profile.                                      |
    | `$EMAIL`            | Inserts the **Email Address** of the Assigned User for the device.                                 |
    | `$FULL_NAME`        | Inserts the **Full Name** of the Assigned User for the device.                                     |
    | `$EMAIL_PREFIX`     | Inserts the **Email Prefix** of the Assigned User for the device. (Everything before the @ symbol) |
    | `$USERNAME`         | Inserts the **Username** of the Assigned User in Iru.                                              |
    | `$USERNAME_PREFIX`  | Inserts the **Username Prefix** of the Assigned User in Iru. (Everything before the @ symbol)      |
    | `$DEPARTMENT`       | Inserts the **Department** of the Assigned User for the device.                                    |
    | `$JOB_TITLE`        | Inserts the **Job Title** of the user that is defined in the identity provider.                    |
    | `$BLUEPRINT_ID`     | Inserts the **Blueprint ID** of the Blueprint the device is assigned to.                           |
    | `$BLUEPRINT_NAME`   | Inserts the **Blueprint Name** of the Blueprint the device is assigned to.                         |
    | `$MODEL_NAME`       | Inserts the **Model Name** of the device the profile installs on.                                  |
    | `$MODEL_IDENTIFIER` | Inserts the **Model Identifier** of the device the profile installs on.                            |
  </Accordion>

  <Accordion title="iPhone and Cellular iPad Only">
    | Variable               | Description                                                                      |
    | ---------------------- | -------------------------------------------------------------------------------- |
    | `$MEID`                | Inserts the **MEID** of the device the profile installs on.                      |
    | `$ICCID_SLOT_1`        | Inserts the **ICCID for SIM slot 1** of the device the profile installs on.      |
    | `$ICCID_SLOT_2`        | Inserts the **ICCID for SIM slot 2** of the device the profile installs on.      |
    | `$IMEI_SLOT_1`         | Inserts the **IMEI for SIM slot 1** of the device the profile installs on.       |
    | `$IMEI_SLOT_2`         | Inserts the **IMEI for SIM slot 2** of the device the profile installs on.       |
    | `$PHONE_NUMBER_SLOT_1` | Inserts the **Phone Number for SIM slot 1** of the profile.                      |
    | `$PHONE_NUMBER_SLOT_2` | Inserts the **Phone Number for SIM slot 2** of the Assigned User for the device. |
  </Accordion>

  <Accordion title="iPhone, iPad, and Apple TV Only">
    | Variable        | Description                                                         |
    | --------------- | ------------------------------------------------------------------- |
    | `$MODEL_NUMBER` | Inserts the **Model Number** of the device the profile installs on. |
  </Accordion>
</AccordionGroup>
