Need help with script to stop Citrix Workspace loading upon bootup

jschank
Contributor

Is anyone out there willing to provide a script that can be used in a policy to prevent Citrix Workspace to open every time you log in to the device?  I came across this post and removing the 4 items does instead stop this from happening.  I'm just not that handy with creating scripts.

 

Thanks in advance.

 

Jim

 

Screen Shot 2022-08-31 at 8.58.10 AM.png

6 REPLIES 6

scottb
Honored Contributor

I just did something like this for our users with another app.

I'll look for the script and see if you can alter it to make it work for you.  You need to do two things with the script:

1) Unload the agents/daemons

2) Delete the above after unloading

scottb
Honored Contributor

Here's the script below.  You can see the ONE item I'm addressing here.  You would replace those with your items in the list.  Give it a shot locally and see how it goes...

#!/bin/bash

# Get the current user - https://scriptingosx.com/2020/02/getting-the-current-user-in-macos-update/
loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

# Get the ID of the current user
userID=$(/usr/bin/id -u $loggedInUser)

# Bootout the Launch Agent
/bin/launchctl bootout gui/$userID /Library/LaunchAgents/net.eaacloop.eaaclient.plist

# sleep
sleep 3

# Remove the LaunchAgent after unload
rm -rf /Library/LaunchAgents/net.eaacloop.eaaclient.plist

mvu
Valued Contributor

Little annoyed that Citrix Workspace did this in one of their last 2 updates. Especially with that big Citrix banner after a reboot. I mean we get it: You're installed and alive.

scottb
Honored Contributor

Yeah, honestly, I wish apps would just have a pref to load at login or not.  Some do, and that's the way it should be.

I don't like when dev's think they should litter my machines with more time-wasting cr@p!

NOVELLUS
Contributor II

I did it in this way:

Spoiler
#!/bin/bash
# Path= /Library/LaunchAgents/com.citrix.ReceiverHelper.plist
#
echo "looking for '/Library/LaunchAgents/com.citrix.ReceiverHelper.plist'"
if [ -f /Library/LaunchAgents/com.citrix.ReceiverHelper.plist ]; then
echo "found '/Library/LaunchAgents/com.citrix.ReceiverHelper.plist'"
echo "deleting '/Library/LaunchAgents/com.citrix.ReceiverHelper.plist'"
rm -f /Library/LaunchAgents/com.citrix.ReceiverHelper.plist
exit
fi
echo "'/Library/LaunchAgents/com.citrix.ReceiverHelper.plist' not found, nothing to do"
exit

mvu
Valued Contributor

@NOVELLUS 

Worked for me. Thanks.