Posted on 12-01-2016 08:10 AM
Hello,
We are trying to push out a web and application filter for our Middle School students. Because each student is an admin on their computer, they can easily uninstall the software. If I place the packages in a hidden folder, is there a script that can check if the application is installed and if not install it from the hidden directory?
Thanks,
Nick
Posted on 12-01-2016 09:11 AM
You can have an extension attribute to look for the application/required files and create a smart group to include machines that come back with an uninstalled response. Then scope a policy as ongoing with the target set to that smart group. Any machine that inventories and is in that smart group would then receive the policy.
Posted on 12-01-2016 10:57 AM
I've started relying heavily on EA for situations like this. Here is a small EA that detects if a folder exists. If you want to search for a file you can use the "-e" flag instead of "-d".
#!/bin/sh
if
[ -d "/Applications/Application Support/Cisco" ]
then
echo "<result>Installed</result>"
else
echo "<result>Not Installed</result>"
fi
Posted on 12-01-2016 11:02 AM
Why use an EA for something like this when the JSS already captures application inventory? I don't understand the reasoning behind an EA, especially since that EA would only get updated on a full inventory collection, same as the regular application inventory it already captures.
Posted on 12-01-2016 11:06 AM
@mm2270 I just provided this as an option. I use an EA like this if I am looking for a specific file or folder that is outside of the Applications folder. But you are right, if its an application then just use the JSS inventory. Much easier.
Posted on 12-01-2016 11:12 AM
@danshaw Sure thing. I love EAs in general and they are great options for non-standard captured items, or when you need the information in a format the JSS doesn't provide. But yes, for something like a regular app, I would go with using the built in captured data to reduce any overhead during recons.
Posted on 12-02-2016 11:00 AM
I would first create a Smart Group with Application Name [LIKE] "application name". Then create a Policy to install the application and scope it to "All Managed Clients" and add the Smart Group to the Exceptions. This will install the application on clients that do not have the app. Make sure to update inventory after installation otherwise the policy will run until your next inventory is complete.