I need to write a script that will find all plist files in /Library/LaunchAgents/ that start with connectwisecontrol and contain onlogin in the file names then unload them.
We use ConnectWise Control for providing remote support to our users. The client is installed on the machine and runs at boot. The problem is that we have an application that is used a few times per year that conflicts with ConnectWise Control. Our solution is to close ConnectWise while the other application is running.
That closes the ConnectWise Agent running in the background and allows the other application to work fine.
My ideal solution would be to use Automator or create or package a script that runs that command and then kicks off the other application when the user clicks it.
The part that I'm unsure of is how to write a script that finds the plist. The xxxxx's in that file vary depending on the computer. I need to search for that plist and then insert it into the unload statement.