I wrote up this script that you can drop into your Code42 deployment to grab the email address of your users using the JAMF API and if the email doesn't exist in JAMF the installer will prompt the user to enter their email before continuing. Hope it's useful for someone else.
jssUser="api_user"
jssPass="api_user_pass"
jssUrl="https://jss_url:8443"
username=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
user_email=$(curl -X GET -sku $jssUser:$jssPass -H "Accept: application/xml" $jssUrl/JSSResource/users/name/$username | xpath /user/email_address 2>/dev/null | sed -e 's/<email_address>//' | sed -e 's/</email_address>//')
ask () {
osascript <<EOF - 2>/dev/null
tell application "SystemUIServer"
activate
text returned of (display dialog "$1" default answer "")
end tell
EOF
}
if [ -z "$user_email" ]; then
name=$(ask 'CODE42 BACKUP - Your email address could not be found, please fill it in to continue: ')
echo "C42_USERNAME=$name"
echo "C42_USER_HOME=$(dscl . -read "/users/$username" NFSHomeDirectory | cut -d ' ' -f 2)"
else
echo "C42_USERNAME=${user_email}"
echo "C42_USER_HOME=$(dscl . -read "/users/$username" NFSHomeDirectory | cut -d ' ' -f 2)"
fi