Mac Scripting – Adobe CC Force Logout

Thursday, February 28th, 2019 | Mac Scripting

So, clearly I’m not keeping this blog up as much as I intended to, but I felt like I needed to make a post here for this. I do a lot of Mac Scripting for my job, and a lot of the time I suspect I’m reinventing the wheel. This is partly because I suspect people don’t always share their solutions to what could be common problems.

I needed a solution to force Adobe CC to log out the current user for my student computer lab. It took me some time to dig up the where the credentials were stored, so I submit to you the resulting script that will force a logout of a use logged in to Adobe CC.

It is worth noting that this will not immediately force a logout, but rather it prevents the user from being logged back in to Adobe CC upon startup. I have this scripted as a logout script so that whenever the computers in my computer lab are rebooted or shut down, they clear the Adobe credentials.

#!/bin/bash

#################################################################
#
# Written by KClose
# Last updated 02/28/2019
#
# This script forces a logout of the Adobe Creative Cloud Application as well as additional Adobe keychain credentials.
# Additional applications may require additional scripting to force a logout.
#
#################################################################

# Define the target user.
# I use JAMF which has a standard variable of $3 for the currently logged in user.
TargetUser=$3

# Look for the OOBE folder.
if [ -d "/Users/$TargetUser/Library/Application Support/Adobe/OOBE" ]; then
	# Reset all credentials for Creative Cloud login. Creative Cloud will not log in on the next reboot.
	echo "Deleting OOBE folder."
    rm -rf /Users/$TargetUser/Library/Application\ Support/Adobe/OOBE
else
	echo "OOBE not found."
fi

# Check for additional Adobe credentials in the keychain.
XDSignOn="$(security find-generic-password -l Adobe\ User\ Info "/Users/$TargetUser/Library/Keychains/login.keychain" | grep -i 'version')"

# If a version number is found, that means there are credentials stored.
if [[ "$SignOn" == *"version:"* ]]; then
	# Clear the additional Adobe credentials.
    echo "Clearing keychain items."
	security delete-generic-password -l Adobe\ User\ Info "/Users/$TargetUser/Library/Keychains/login.keychain"
	security delete-generic-password -l Adobe\ User\ OS\ Info "/Users/$TargetUser/Library/Keychains/login.keychain"   
else
	echo "No additional credentials found."
fi

echo "Adobe Credentials cleared."

Tags: , , , , , ,

1 Comment to Mac Scripting – Adobe CC Force Logout

Matt
October 28, 2022

Hi, is this script still current?

Leave a comment

Social Slider

BoardGameGeek

Calendar

February 2019
S M T W T F S
 12
3456789
10111213141516
17181920212223
2425262728