Posted on 09-07-2023 05:08 AM
We have an application installed on all of our Macs called Egnyte Connect which we want to remove. This application was deployed using a pkg via JAMF. Egnyte have given us a command to run their uninstaller.
sudo /Applications/Egnyte\ Connect.app/Contents/Resources/Egnyte\ Connect\ Uninstaller.app/Contents/MacOS/Egnyte\ Connect\ Uninstaller
How can I use this command in JAMF? I tried using it in a script but that didn't work.
#!/bin/bash
sudo /Applications/Egnyte\ Connect.app/Contents/Resources/Egnyte\ Connect\ Uninstaller.app/Contents/MacOS/Egnyte\ Connect\ Uninstaller
What's the best way to approach this?
Thanks
09-07-2023 05:34 AM - edited 09-07-2023 05:36 AM
@sparrowhawk When running via Jamf Pro you can omit the sudo as Jamf will already be running the command as an admin.
Since it's a single command to run the uninstall easiest way to run would be via the Execute Command entry in a Files & Processes payload of a Policy. The escaping of the path for the uninstaller looks good, so if that doesn't work please post the log when running the policy so any error it's reporting can be identified.
Posted on 09-07-2023 07:23 AM
Hi @sdagley , thanks for your post! I've learned something new here already. I wasn't aware of the Files & Processes ability to run a command, so thanks! I set that up and although it ran the command, the application wasn't removed and there was no result recorded.
Have I set it up incorrectly?
Posted on 09-07-2023 07:48 AM
@sparrowhawk Can you try running the command from Terminal on a Mac with the software installed and see if that works? (you'll need to include the sudo for that) And if it doesn't is there any additional information reported when you run the uninstaller that way?
Posted on 09-07-2023 07:56 AM
I've already tested that and it works when run locally.
Posted on 09-07-2023 08:09 AM
What happens if you run the uninstaller without the sudo? And are all of your user accounts Admin accounts, or are they Standard accounts?
Posted on 09-07-2023 08:58 AM
Do you mean run the command locally without sudo? Our standard accounts aren't admins.
Posted on 09-07-2023 09:34 AM
If I had to guess, this command probably only works in a user context, since it's an executable from the app bundle. It probably launches an app that needs to be responded to to complete the uninstallation. Some other apps work this way too, like the uninstaller for Cisco AnyConnect.
Is that the case when you run it locally on a device instead of from a Jamf Pro policy?
Posted on 09-08-2023 06:59 AM
@sparrowhawk Any response to @mm2270 's question regarding user interaction when running the uninstaller locally? That would definitely impact attempting to run the removal via a script.
Posted on 09-11-2023 01:30 PM
Posted on 09-08-2023 05:16 AM
Hi,
try this as script
#!/bin/bash
# Check if Egnyte Connect is installed
if [ -e "/Applications/Egnyte Connect.app" ]; then
# Uninstall Egnyte Connect
sudo /Applications/Egnyte\ Connect.app/Contents/Resources/Egnyte\ Connect\ Uninstaller.app/Contents/MacOS/Egnyte\ Connect\ Uninstaller
echo "Egnyte Connect has been uninstalled."
else
echo "Egnyte Connect is not installed on this system."
fi
exit 0
09-11-2023 02:00 PM - edited 09-11-2023 02:01 PM
Hi @Deku91, you've cracked it! I just had to add a pkill "Egnyte Connect" as the application can't be running and setting the script to launch at login wasn't quick enough. The notifications didn't pop up, but I'm not worried about those.
Thanks all. I love JAMFNation, you guys rock! 🤘