Posted on 10-29-2018 10:57 AM
Title says it all, I want to create an Extension Attribute that let's me know if users are signed into the Creative Cloud Desktop application.
I can't seem to find anything that would indicate it's signed in, with FSMonitor... still hunting. Any help appreciated.
Posted on 10-29-2018 01:07 PM
kabam, enjoy boys!
This script depends on the CCX Process.log being there. There are some instance where I have seen it not be created right away. Anyway, should work well enough to give me an idea.
#!/bin/bash
currentUser=$(ls -l /dev/console | awk '{print $3}')
userHome=$(dscl . read /Users/$currentUser NFSHomeDirectory | awk '{print $2}')
TodaysDate=`date "+%s"`
#CCX Process.log location
logloc="$userHome/Library/Logs/CreativeCloud/CCX Welcome/CCX Process.log"
#check if open
if pgrep "Creative Cloud"; then
ccOpen="is open."
else
ccOpen="is not open."
fi
#check if signed in recently
IFS=$'
'
SignIns=()
if [ -f $logloc ]; then
SignIns=($(cat $logloc | grep "ACCC Sign-on State: signin_success" | awk '{print $2,$3,$4}' | awk 'BEGIN{ RS = "" ; FS = "
" }{print $0}'))
if [ -z $SignIns ]; then
Echo "<result>Not Signed In Successfully and CCDA $ccOpen</result>"
exit 0
fi
#if the sign in was less than 90 days ago we will consider it a success.
for x in ${SignIns[@]}; do
SignInEpoch=$(date -jf '%b %d %Y' $x +%s)
Difference=`expr $SignInEpoch - $TodaysDate`
NumOfDaysSinceSignIn=`expr $Difference / 86400`
if [ $NumOfDaysSinceSignIn -le 30 ]; then
echo "<result>Signed in $NumOfDaysSinceSignIn days ago. CCDA is $ccOpen</result>"
exit 0
fi
done
echo "<result>Signed in but not in the last 30 days. CCDA $ccOpen</result>"
else
echo "<result>CCX Process.log does not exist and CCDA $ccOpen</result>"
fi
Posted on 10-29-2018 01:47 PM
This is helpful! We have a mix of Volume and Subscription, so I look at the swidtag to see what kind of license the machine is using
#!/bin/sh
# Adobe SWID file
adobeFile="/Library/Application Support/regid.1986-12.com.adobe/regid.1986-12.com.adobe_V7{}CreativeCloudEnt-1.0-Mac-GM-MUL.swidtag"
################################
# Get the username of the logged in user
loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk -F': ' '/[[:space:]]+Name[[:space:]]:/ { if ( $2 != "loginwindow" ) { print $2 }}' )
# Make sure someone is logged in
if [[ -z "$loggedInUser" ]]; then
echo "No one logged in"
exit 1
fi
## See if file is actually present, if it is, result is echod. Else, result shows TYPE:loggedInUser
if [[ ! -f "$adobeFile" ]]; then
result="ASU Creative Cloud Not Installed"
else
## Find channel type
# VOLUME == Full installer
# SUBSCRIPTION == named-user
# UNKNOWN == uninstalled or other error
channel_type=$(xmllint --xpath "//*[local-name()='license_linkage']/*[local-name()='channel_type']" "$adobeFile"
| sed -e 's/<swid:channel_type>//;s/</swid:channel_type>//')
if [[ "$channel_type" =~ "VOLUME" || "$channel_type" =~ "SUBSCRIPTION" ]]; then
result=$channel_type:$loggedInUser
echo $result
elif [[ "$channel_type" =~ "UNKNOWN" ]]; then
result="ASU Creative Cloud uninstalled"
echo $result
else
result="ASU Creative Cloud error"
echo $result
fi
fi
Posted on 10-29-2018 02:43 PM
A python man, eh. I can't get myself to make the switch to learn it. Yours is useful too. Thanks, I'll take a look into this tomorrow. Maybe a combo of two will be best.