This document provides a detailed guide on how to install the Viio Desktop Agent using Kandji Custom Script, and injecting a tenant‑specific VIIO_CUSTOMER_KEY and VIIO_EMPLOYEE_EMAIL during installation.
This installation workflow uses two Kandji library items:
Custom Profile – installs the Global Variables MobileConfig to expose device metadata (owner email, serial, etc.) under /Library/Managed Preferences/io.kandji.globalvariables.plist.
Custom Script – checks for that plist, extracts the email, and runs the Viio installer one‑liner.
Create the Global Variables profile
In Kandji, go to Library → Add New Item → Custom Profile → Add & Configure.
In the profile drawer:
Name: Global Variables.
Assignment: Select Blueprints that will receive the Viio Desktop Agent
Profile → Upload Profile → choose the MobileConfig downloaded from: https://raw.githubusercontent.com/kandji-inc/support/main/Global%20Variables/Global%20Variables.mobileconfig.
Click Save
Result: Within one check‑in cycle Kandji creates /Library/Managed Preferences/io.kandji.globalvariables.plist containing keys such as EMAIL, SERIAL, DEVICE_NAME, etc.
Create the Custom Script
Go to Library → Add New → Custom Script → Add & Configure.
General
Name: Install Viio Desktop Agent.
Execution Frequency: Install once per device (or more often if you want self‑healing).
Script Details
Copy and paste the script below. Replace XXXXXXXXXXXXXXX with your customer key before pasting.
globalvarcheck=$(ls /Library/Managed\ Preferences/io.kandji.globalvariables.plist)
if [ "${globalvarcheck}" == "/Library/Managed Preferences/io.kandji.globalvariables.plist" ]
then
echo "Global variables present."
else
echo "Global variables are NOT installed."
exit 1
fi
EMAIL=$(/usr/libexec/PlistBuddy -c 'print :EMAIL' /Library/Managed\ Preferences/io.kandji.globalvariables.plist)
VIIO_CUSTOMER_KEY="xxxxxxxxxxxxxxxxxxxxxxx" VIIO_EMPLOYEE_EMAIL="${EMAIL}" bash -c "$(curl -L https://raw.githubusercontent.com/viio-io/agent-installer-scripts/main/macos.install.sh)"
Click Save
Suggested rollout order
Push the Global Variables profile first and allow endpoints to check in (≈ 5 minutes on‑demand, up to 15 minutes automatic).
After confirming the Global Variables profile exists on a pilot Mac, push the Install Viio Desktop Agent script.
Go to Settings → Privacy & Security → Profiles