2 weeks ago
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
2 weeks ago - last edited 2 weeks ago
@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.
2 weeks ago
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?
2 weeks ago
@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?
2 weeks ago
I've already tested that and it works when run locally.
2 weeks ago
What happens if you run the uninstaller without the sudo? And are all of your user accounts Admin accounts, or are they Standard accounts?
2 weeks ago
Do you mean run the command locally without sudo? Our standard accounts aren't admins.
2 weeks ago
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?
2 weeks ago
@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.
2 weeks ago
2 weeks ago
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
2 weeks ago - last edited 2 weeks ago
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! 🤘