@jtrant We're using the following to capture the username:
#!/bin/bash
####################################################################################################
# Extension Attribute to determine the Enterprise Connect Username
####################################################################################################
# Get the logged-in user's username
loggedInUser=$( /usr/bin/stat -f %Su "/dev/console" )
if [[ ${loggedInUser} == "root" ]] || [[ ${loggedInUser} == "localadmin" ]] || [[ ${loggedInUser} == "adobeinstall" ]] || [[ ${loggedInUser} == "_mbsetupuser" ]] ; then
result="${loggedInUser}"
else
if [[ -e "/Applications/Enterprise Connect.app/Contents/SharedSupport/eccl" ]] ; then
adUsername=$( /usr/bin/su - "${loggedInUser}" -c "/Applications/Enterprise Connect.app/Contents/SharedSupport/eccl -p adUsername" | /usr/bin/sed 's/adUsername: //' )
if [[ ${adUsername} == "missing value" ]]; then # Enterprise Connect installed, but user is NOT logged in
result="${loggedInUser} NOT logged into Enterprise Connect"
else # Enterprise Connect installed and the user is logged in
result="${adUsername}"
fi
else
result="${loggedInUser} NOT logged into Enterprise Connect; eccl missing"
fi
fi
echo "<result>${result}</result>"
exit 0
Signed-in Status would be:
/Applications/Enterprise Connect.app/Contents/SharedSupport/eccl -p signedInStatus | /usr/bin/sed 's/signedInStatus: //'
That's exactly what I'm looking for. Thank you Dan!