Download Package From JSS

mccallister
Contributor

I want to download a DMG package I have on our JSS server to examine the package contents. How do I download a package from JSS?

18 REPLIES 18

mccallister
Contributor

Disregard, it turns out that it was a simple matter of connecting via Finder with smb://serveraddress

joethedsa
Contributor II

Can you do this with a cloud instance with Jamf? I would like to download a package was uploaded to Jamf. Is this possible?

mm2270
Legendary Contributor III

Not with a cloud instance, at least not using the method mentioned above of navigating to a share in the Finder. Cloud DPs are entirely HTTPS based, so there's no share that gets mounted to a machine.

However, if you only have a handful of packages you need to pull down again, you can create a temp policy that has those packages added to it, but all set to Cache instead of Install. Scope it to your Mac or another one you have access to and let that policy run. The packages will be cached into /Library/Application Support/JAMF/Waiting Room/
The Waiting Room folder is locked by default, so to extract the contents to your Desktop or some other location, you can run this in Terminal after the policy is done

sudo find /Library/Application Support/JAMF/Waiting\ Room -name *.dmg -o -name *.pkg -exec cp {} /path/to/folder/ \;

That should locate any .pkg or .dmg files cached in the Waiting Room and copy them to another location. Remember to change the /path/to/folder/ to something legit.

CGundersen
Contributor III

Not cloud (yet), but couldn't curl still be used?

curl -O -u username:password https://cloudurl/path/file.pkg

joethedsa
Contributor II

@mm2270, does the cached package get removed after the policy? When I ran the command after the policy was done, nothing happens. The command "runs" after pressing return with no errors but the Waiting Room folder doesn't go to the target folder (I used Desktop).

joethedsa
Contributor II

@CGundersen, When I navigate to the package in the console, there is no path that includes the actually .pkg file in the URL so I don't think that will work. You would think that JSS would provide a "two-way" communication scripts, packages, etc.

mm2270
Legendary Contributor III

@joethedsa No, caching the package should leave it on disk, like I said, until something removes it later. If you have any policies that are set to install all cached, then when that runs it would try to install anything in that Waiting Room folder and then remove them.

If the command I gave you isn't working, try opening a root shell to navigate into the Waiting Room folder. Run these commands in Terminal

sudo -s
<enter password when prompted>
cd /Library/Application Support/JAMF/Waiting Room/
ls -l

The last one should list the contents of the Waiting Room folder. See what's in there.

joethedsa
Contributor II

@mm2270, I'm getting the same result when following your commands. the ls -l command just goes back to the bash prompt after hitting the "Return" button. No errors or nothing. Hmm...

mm2270
Legendary Contributor III

@joethedsa Are you sure the policy to cache the package ran successfully? If it did, the pkg should be in that location. I would go back and double check your policy. Make sure where the package is added that it's set to "Cache" and not "Install" from the action drop down. If it ran already in the policy log, flush it so it will run again. Once you see that it has run, go back and check that folder again.

scottb
Honored Contributor

I have been using the method @mm2270 posted for years. Sadly, this is the only way to do it. They allow for downloading other items from the (cloud) JSS, so why not packages? I hate having to keep copies of all the JSS' I manage.
I wonder if there's a FR for this...
*Edit: I actually do it a little differently. I just opened up the priv's on the Waiting Room folder rather than copying items elsewhere...

joethedsa
Contributor II

@mm2270, thank you. I overlooked the cache setting in the policy. This worked flawlessly after that. Thanks for the tip. Cheers!

FletcherS7
New Contributor

You can also copy the download link and token from the policy logs. 2008e5ce9b434d0b9188851cbc4624c5

joethedsa
Contributor II

@FletcherS7 , Thank you. I will have to try that.

globaldominatio
New Contributor II

Hi @joethedsa were you able to achieve this? I want to be able to download as well but cant find a way.

leslie
Contributor II
Contributor II

@globaldomination - this help?
https://github.com/BIG-RAT/jamfcpr

scottb
Honored Contributor

@leslie - thx - this works great! Should be a Jamf tool by default!

joethedsa
Contributor II

@globaldomination , yes I was able to get it to work by following what @mm2270 shared on 3/8/2019. I ended up using the running the command in the "Files and Processes" payload and copied the package to a tmp folder. I wasn't sure how permissions were going to be handled but I was able to execute the .pkg file with no issues. Hope this helps!

tthambi
New Contributor

I was able to get it to work following the response Posted: 3/12/2019 at 9:37 AM CDT by @mm2270 using terminal.
Once I verified the files , used the simple cp command to dump the files to a known folder and it worked. eg: cp *.pkg /Users/"user folder"/Documents/untitled folder