Posted on 04-30-2018 11:40 AM
Hi there,
I'm wondering if anyone has tried to create an Extension Attribute to show whether Enterprise Connect is active and the user is logged in?
Having the client is one thing, but I'd like to find out which users are actually logged into the client.
Thanks a lot!
Justin.
Posted on 04-30-2018 12:07 PM
@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
Posted on 04-30-2018 12:10 PM
Signed-in Status would be:
/Applications/Enterprise Connect.app/Contents/SharedSupport/eccl -p signedInStatus | /usr/bin/sed 's/signedInStatus: //'
Posted on 04-30-2018 12:51 PM
That's exactly what I'm looking for. Thank you Dan!