

Is it a new script or an update of an existing script, what is the category where the script is located, what are the different parameters and so on. config.json : Here, we will define the different options of our deployment.You’ll define the different actions to perform, the environment variables to use or the notifications to send for example. deploy.yml : This file contains the configuration for GitHub Actions.Let’s see what’s the purpose of each file : To display and create hidden folders, press Cmd + Shift +. On your computer, clone the repository, and then create the files and folders, following this structure :
Jamf api scripts password#
Enter the password and click on Add secret. Now, create a secret called JAMF_PASSWORD. In your repository, go in Settings, then Secrets and click on New repository secret. Now, we will setup the repository in GitHub.įirst, you’ll have to add the password of the user you’ve just created as a secret in Github. In the Jamf Console, create a new user with just the rights to Create, Read and Update scripts. Prerequisites Creation of a dedicated user in Jamfįor security concerns, I prefer to create a user dedicated only for the deployment purpose, with very limited rights. All kudos should go to the original post. As it’s in Japanese and as I also did some additions to this, I wanted to share my implementation. I also found this post, describing exactly what I wanted to do. As I was looking for a way to use Github as a version control tool, there was a session about this subject in VJNUC 2021.

Jamf api scripts pro#
Printf " $PackagesID\t %s\n " " $PackagesName " > " $report_file "Įcho -e "\nDeleted $PackagesName – package ID $PackagesID.\n "Įcho -e "\nERROR! Failed to delete $PackagesName – package ID $PackagesID.\n "Įcho "All Jamf Pro IDs are expressed as numbers.Deploying scripts on Jamf Pro is very common, but I found we lack versioning, rollback and team work on that part. usr/bin/curl -su $/ $PackagesID " -X DELETE

To put the script into simulation mode, comment out the following line of the script. It is also possible to simulate a run of the script, to make sure everything is working before running the actual deletion. To store the account password in the plist file:ĭefaults write -info jamfpro_password account_password_goes_here To store the account username in the plist file:ĭefaults write -info jamfpro_user account_username_goes_here To store the Jamf Pro URL in the plist file:ĭefaults write -info jamfpro_url The plist file can be created by running the following commands and substituting your own values where appropriate:
Jamf api scripts manual#
path/to/delete_Jamf_Pro_Scripts.sh /path/to/text_filename_here.txtįor authentication, the scripts can accept manual input or values stored in a ~/Library/Preferences/ file. path/to/delete_Jamf_Pro_Packages.sh /path/to/text_filename_here.txt Once you have the text file and the other prerequisites, the scripts can be run using the following commands: The test file should contain only the relevant Jamf Pro IDs and appear similar to this:

A text file containing the Jamf Pro package or script IDs you wish to delete.To use these scripts, you will need four things: Generate a report of which packages or scripts were deleted.įor more details, please see below the jump.īoth scripts work with a text file of Jamf Pro IDs, and also include error checking to make sure that the text file’s entries contained only positive numbers.Delete the relevant installer packages or scripts.To help with this, I’ve written a couple of scripts to help automate the deletion process by using a list of Jamf IDs and the API to perform the following tasks: If you’re using AutoPkg and tools like jamf-upload or JSSImporter to automate the uploading of packages and scripts to your Jamf Pro server, it may be necessary to periodically delete a large number of now-obsolete installer packages or scripts from your server.
