Reporting on Mac App Store Apps?

New Contributor III

So, we started deploying apps like OneDrive through Mac App Store Apps in JAMF pro, and I'm trying to report on the installations for various reasons.

When I look at the MacAppStore Apps install for OneDrive I see our total licenses purchased, usage, and remaining. However, when I go to create a Smart Search or Advance Search, the numbers of machines with the software installed doesn't match the usage numbers. There's about 300 machines more machines showing up in usage than the searches. Is there a way to see which machines are in the Usage column?




Esteemed Contributor III

You can identify non App Store copies if they don't have the /Applications/ folder.

# Identify App Store vs non App Store.

if [ -e /Applications/ ]; then
    if [ -e /Applications/ ]; then
        echo "<result>AppStoreCopy</result>"
        echo "<result>NonAppStoreCopy</result>"
    echo "<result>NotInstalled</result>"

[Edit: removing part of my response to avoid confusion]


Legendary Contributor III

Just a quick FYI. mdls is better for determining App Store based apps vs standalone installs.

$ mdls /Applications/ -name kMDItemAppStoreHasReceipt
$ kMDItemAppStoreHasReceipt = 1

The "1" means it's from the App Store. If it's (null) then its not.
You can even see the "purchase date" from App Store installs, which I think actually corresponds to the last time it was updated from the App Store, not the real original purchase date. I say that because I know for certain I purchased TextWrangler from the App Store years ago, not just earlier this month :)

$ mdls /Applications/ -name kMDItemAppStorePurchaseDate
$ kMDItemAppStorePurchaseDate = 2017-04-05 04:08:33 +0000

I'm not sure, but I wonder if this purchase date info actually shows up for VPP installed apps? It may or may not. Worth checking on to see if it helps track down ones from VPP vs regular App Store purchases vs non App Store installed apps.

Valued Contributor III

@mm2270 VPP Purchased apps actually have quite a lot of VPP information in there
kMDItemAppStoreReceiptIsVPPLicensed = 1
kMDItemAppStoreReceiptOrganizationDisplayName = "Your Business Name Shows Here"
kMDItemAppStoreReceiptType = "ProductionVPP"
kMDItemAppStorePurchaseDate = 2017-01-19 20:49:29 +0000 This appears to match the date we VPP purchased TextWrangled as an organisation

Legendary Contributor III

@Look Ok, even better! I couldn't tell since I don't use VPP here and had nothing to test against. Seems like a good way of knowing which apps came from VPP and which did not then.

Contributor II

To add to what @donmontalvo said above, we have run into an issue where we have both the App Store version and a version downloaded from Unbeknownst to us when we were pushing out via JAMF Pro the user preferences for each of those products is located in different places. Thank you Microsoft.... bangs head on wall

To compound issues we used one of @rtrouton tricks for grabbing the App Store .pkg prior to installation so there is no _MASReciept folder. I was able to poke around and write an Extension Attribute to find which version of the app is installed. The App Store version will return "Store" and the version direct from Microsoft will return "Standalone". Just some added information.

if [ ! -e /Applications/ ] 
then echo "<result>Not Installed</result>"
PVER=`defaults read /Applications/ MSAppType`
echo "<result>$PVER</result>"