Posted on 08-07-2018 03:27 AM
Hi All
I have a task of completely removing ADPassMon from my environment. There are about 400 Macs to do this on.
I have run sudo rm -rf /Applications/ADPassMon.app, it removes it from Applications folder but still appears at the top right hand side.
Has anyone done something similar with that product. Would grateful for the advice.
Posted on 08-07-2018 03:35 AM
Here's a script I'm currently testing with good results. I hope to move to NoMad soon but I've got a lot on my plate right now.
#!/bin/bash
#variable for storing the current users name
currentuser=`stat -f "%Su" /dev/console`
osascript -e 'quit app "ADPassMon"'
pkill ADPassMon
# Use this command to remove ADPassMon from the users' Login Items
osascript -e 'tell application "System Events" to delete login item "ADPassMon"'
# use this command to kill and delete the launch agent
# if you have a launch agent in /Library/LaunchAgents instead of the user home folder, you'll have to adjust the path accordingly
launchctl unload /Users/$currentuser/Library/LaunchAgents/org.pmbuko.ADPassMon.plist
rm -Rf /Users/$currentuser/Library/LaunchAgents/org.pmbuko.ADPassMon.plist
# delete ADPassMon from the computer
rm -Rf /Applications/ADPassMon.app
# delete the ADPassMon preferences from within users' home folder
rm -Rf /Users/$currentuser/Library/Preferences/org.pmbuko.ADPassMon.plist
exit 0
Posted on 08-07-2018 03:37 AM
Thank you so much!!, let me give that a try!!
Will let you know of the results & yes we are looking to go to NoMAD.
Posted on 08-07-2018 03:37 AM
It really depends on how it was deployed.
@k84 sounds like there is a launch agent which is keeping the app "running".. @AVmcclint posted a way to unload the launch agent, but ADPassMon didn't ship with one.. so it can be called anything for your environment.
However, deleting the app bundle then logging out/restarting should work.
Posted on 08-07-2018 07:29 AM
Good point. I forgot that I had to make the LaunchAgent by hand. Luckily the script I'm using covers launchagents and items in the user's Login Items. Of course if your manually created launchagent has a different file name, you'll have to adjust the script accordingly. Personally, I don't like just deleting apps that automatically launch at startup without removing the mechanism that makes it do that. I've had launchagents in the past go bonkers and fill up my system.log with thousands of entries that it can't find the app it's supposed to be launching. However you do it, this script should point you in the right direction to accomplish your goal.