Download Packages from Jamf

Buraq
New Contributor III

Sorry if this is a simple one but couldn't find an answer elsewhere
After I upload a package to Jamf, is there a way to download it? Giving I don't have the original package and it's not in Composer.

I need this to be able to push the package through Munki and/ or Deploy studio

Thanks!

1 ACCEPTED SOLUTION

ryan_ball
Valued Contributor

@Buraq If your distribution point is on-site, you can get the package from there via smb. Alternatively you can create a policy to cache the package on a Mac (or use Jamf Remote), then go get it afterward.

The package would be here I believe:

/Library/Application Support/JAMF/Waiting Room

View solution in original post

9 REPLIES 9

ryan_ball
Valued Contributor

@Buraq If your distribution point is on-site, you can get the package from there via smb. Alternatively you can create a policy to cache the package on a Mac (or use Jamf Remote), then go get it afterward.

The package would be here I believe:

/Library/Application Support/JAMF/Waiting Room

Buraq
New Contributor III

@ryan.ball Amazing thanks. The caching policy worked. The waiting room folder was locked though and I had to chmod it.

Thanks again!

ryan_ball
Valued Contributor

@Buraq Just do the following and navigate into via root

sudo su -
# Enter password at prompt

cd /Library/Application Support/JAMF/Waiting Room/

mpineyro
New Contributor II

Replicate DP from JAMF admin to local drive?

Mithrandir
New Contributor III

Using the following syntax:

curl -k -v -u user:password https:/jss.host.com:8443/JSSResource/packages -T xmlFile.xml -X POST <--from here: https://community.jamf.com/t5/jamf-pro/can-we-add-packages-to-the-jss-thru-the-api/m-p/51171

I was able to auth to my cloud instance, putting a file there. Utilizing a web browser, I navigated to the URL, which just showed me a wall of text, but the text was all my package names!

 

Going back to terminal, and using the following syntax:

curl -L -o [Numeric Value assigned by JSS]Package_Name.pkg --user apiuser:password https:/your.jss.instance:443/JSSResource/packages/22test_package.pkg -X POST

It downloaded without issue!

I tried that, and I got a file named 27mypackage.pkg, but it was only a few hundred bytes, and clearly wasn't the whole package.

Thanks for posting this! Following is a modified version utilizing API auth via bearer token:

 

#!/bin/zsh

apiUsername=your_api_user

apiPassword=your_api_password

jssServer=https://your.jss.com:443 (or 8443 if onprem)

 

# request auth token

authToken=$( /usr/bin/curl \

--request POST \

--silent \

--url "$jssServer/api/v1/auth/token" \

--user "$apiUsername:$apiPassword" )

 

echo "$authToken"

 

# parse auth token

token=$( /usr/bin/plutil \

-extract token raw - <<< "$authToken" )

 

tokenExpiration=$( /usr/bin/plutil \

-extract expires raw - <<< "$authToken" )

 

localTokenExpirationEpoch=$( TZ=GMT /bin/date -j \

-f "%Y-%m-%dT%T" "$tokenExpiration" \

+"%s" 2> /dev/null )

 

echo Token: "$token"

echo Expiration: "$tokenExpiration"

echo Expiration epoch: "$localTokenExpirationEpoch"

 

curl -L -o digitPackageName.pkg -H "Authorization: Bearer $token" 'https://your.jss.com:443/JSSResource/packages/digitPackageName.pkg' -X POST

Found that I didn't have to upload a dummy package, and could auth via my admin crews to the package folder on my JSS

Replied to myself! Hilarious! Too much going on.

Thanks for posting this. I keep a copy of all the packages I upload, but in my current job I inherited Jamf administration from someone less fastidious.  The last time I needed a package, I used the "install cached" method and found the package in the waiting room.

Next time, I'll use your script.