Installing Mac VPP App via script

casafrancisco
New Contributor III

Hi everyone,

We have a couple apps that are on our Self Service that are VPP applications. I am trying to simplify our Deployment process and wanted to see if anyone knows if there is a way to install an App in Self Service via a script.

I am creating a policy in which it calls the custom triggers I need and runs a couple scripts. But with the remaining apps that are VPP apps I wanted to send a command to install them automatically so we don't need to install them individually. One of the apps for example is Slack.

Trying to get us to 1 Touch Deployment, then wittle away to try and accomplish zero-touch!

4 REPLIES 4

ThijsX
Valued Contributor
Valued Contributor

VPP apps scopted to computers and installed automatically are only being installed after an RECON, as far i know there is not currently an other way to trigger those apps.

You can do something like this?

#!/bin/zsh

appTitle="Slack"

if [ -d /Applications/"${appTitle}".app ]
then
    if [ -d /Applications/"${appTitle}".app/Contents/_MASReceipt/ ]
    then
        result="${appTitle} is already installed through VPP/Appstore"
    else
        result="${appTitle} is not installed through VPP/Appstore, going to do a recon to trigger an install."
        /usr/local/bin/jamf recon
    fi
else
    result="Cannot find ${appTitle}.app overall, going to do a recon to trigger an VPP Install."
    /usr/local/bin/jamf recon
    fi

echo "<result>$result</result>"

casafrancisco
New Contributor III

Thanks @txhaflaire I'll give this a try.

I also just thought of an idea if that doesn't work. I could write a script to touch a file, and use an EA to check if that file exists. Then create a smart group for if that EA is populated.

tlarkin
Honored Contributor

You can use Spotlight for this, to return all the installed apps that are from the App Store. You would have to code a lot of logic around calling the manual trigger if they weren't present on the filesystem.

mdfind -onlyin /Applications/ -name "kMDItemAppStoreHasReceipt = 1 && kMDItemKind = Application"
/Applications/Keynote.app
/Applications/Xcode.app

Those are the only 2 App store apps on my Mac currenlty.

JamfMyMac
Contributor

not sure about you guys.. have you tried

Computers > Mac Apps Store Apps > The VPP App > Install Automatically option.

I have this setup with our Office 365.. My issue is that we cant control when this gets installed. I wish JAMF could fix this.
In other words. it would auto push on its own schedule..
While typing this.. i just thought we can create Smart Group and scope it to machines who dont have office 365.. hmmm or just finished enrollment process....