/Applications Folder vs User's Applications Folder

a_holley
Contributor

Hi guys,

Wondering if anyone has figured out a way to tell if the user has an app installed in their home Applications folder (or god forbid Desktop) rather than the top level Applications folder?
We are running inventory on /Users so we know that they have the app installed, but besides manually checking every computer record, it's hard to know WHERE the app is installed.

We've got two main culprits that I'm trying to get on top of: Chrome & Zoom. Once I can narrow down which computers don't have these installed in /Applications I can find a way to clean them up.

1 REPLY 1

joshuaaclark
Contributor

I would make an Extension Attribute as a script to run on all computers during Recon named UserAppChrome. Make a smart group based on the Extension attribute to collect your culprits where value like YES. Make one for each app.

#!/bin/sh

currentUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }')
appName="Google Chrome.app"
file1="/Users/$currentUser/Applications/$appName"

if [[ -e "$file1" ]]
then
    echo "<result>YES</result>"
else
    echo "<result>NO</result>"
fi