Prey Project Mass Deploy through

yancyg
New Contributor

Prey Project Mass Deploy Issues - i have made a package of the prey software using the following information in composer on a 10.9.4 MBP. I am having issue with the deployment -

Below is the prey project general info. I made a snap shot and modified .dmg in composer of the install - it worked on the end unit but could not get to work via JSS. Any ideas - i made a dmg package with the info below, not sure if it need to be a .pkg or and additional script.

To install Prey in batch mode on a Mac environment, you'll need to use OS X's installer command using the meta package (MPKG) instead of the regular DMG installer.

Download the latest MPKG package (prey-X.X.X-mac-batch.mpkg.zip) from our release archive Run the following command on a terminal: API_KEY="YOUR_API_KEY" sudo -E installer -pkg PATH_TO_MPKG_FILE.mpkg -target /

Where YOUR_API_KEY is your account's API key (you can get your API key from your account's profile page). To install version 0.6.2 using an API key abcdef123456 you'll need to run in a terminal:

API_KEY="abcdef123456" sudo -E installer -pkg prey-0.6.2-mac.mpkg -target /

The installer will validate the API key and make sure that the account has available slots to add that device. If conditions are met, then Prey will be set up and the device will automatically appear in the Devices section of your Prey account.

https://help.preyproject.com/articles/63-how-to-mass-deploy-prey-for-mac-os-x

10 REPLIES 10

bwiessner
Contributor II

I figured this out. Still interested?

bbordeaux
New Contributor

I am interested on how you did it..

dyyuan
New Contributor

I can get the command line working in terminal...API_KEY=foobar123 sudo -E installer -pkg prey-mac-1.X.X-x86.pkg -target /

How would we then translate that into something casper can deploy?

thanks.

robertojok
Contributor

dyyuan did you get an answer how to deploy via casper? Like you the command actually installs prey but I have not worked out how to package it for deployment via casper...

lkrasno
Contributor II

Using one policy, we set to the package to cache/stage in a custom location, just using composer

and thereafter ran install command

!#/bin/bash
sleep 100 && API_KEY=ABC123 sudo -E installer -pkg '/Library/Application Support/YourCO/preymac.pkg' -target /
exit 0

stevewood
Honored Contributor II
Honored Contributor II

I recently needed to deploy Prey to a laptop that was stolen. I used an FTP site to stage the installer on and then used a script to download and install:

#!/bin/bash

# Name: deployPrey.sh
# Date: 12 Feb 2016
# Author: Steve Wood (swood@integer.com)
# Purpose: to utilize curl to deploy Prey on a stolen laptop and have it check in to the Prey Project servers

ftpSrv='ftp.mycompany.com'
ftpUser='ftpuser'
ftpPass='ftppass'
preyFile='prey-mac-1.5.0-x86.pkg'
apiKey='yourpreyapikey'

# first grab the installer from the FTP server using curl
curl ftp://$ftpUser:$ftpPass@$ftpSrv/$preyFile > /tmp/prey-mac-1.5.0-x86.pkg

# install using Prey's instructions
API_KEY=$apiKey installer -pkg /tmp/prey-mac-1.5.0-x86.pkg -target /

bfrench
Contributor III

@stevewood I'm not great at scripting - how would I alter your script for tftp? I tried to just substitute but then got cert errors and curl -k did not work either. Any help appreciated.

stevewood
Honored Contributor II
Honored Contributor II

@bfrench I have not tried to use TFTP to do this, but it should be as easy as switching out ftp for tftp, at least that is what the curl spec says. The -k option should do the trick, but if it didn't in your testing, then it must be something else. I would check the certs on the tftp server you are trying to download from.

If your distribution point is public facing and is an HTTPS share, you could switch to just using the https URL:

curl https://your.jss.com/<sharename>/preypackage.pkg

I just switched my script above to use HTTPS instead of FTP.

lkrasno
Contributor II

@bfrench

you could also just deploy the package to a temporary location, including cache, such as Waiting Room and install from there?

API_KEY=XOXOXOXO sudo -E installer -pkg '/Library/Application Support/YOUR_CO/preymac.pkg' -target /

bfrench
Contributor III

@stevewood I finally got it to work on my test device - turned out my test device - that had not been used in a while - had the wrong date/time. Once that was correct the script installed. Now waiting for the missing device to check back in.....

Thanks for your help.