

| sed 's/Newly Assigned/All/g' \ > "/path/to/ExampleProfile-parsed.xml" # Check the destination server to see if an existing profile of this name exists existing_id = $(Ĭurl -s -N -X GET \ -H "Accept: application/xml" \ -H "authorization: Basic $destination_instance_encrypted_credentials " \ " \ | xmllint -format - > "/path/to/ExampleProfile-fetched.xml" # Parse the XML to remove IDs and ensure the profile is redeployed to all computers in scope cat "/path/to/ExampleProfile-fetched.xml" \ # Get the profile from the source instance and format it nicely to help with parsingĬurl -X GET \ -H "Accept: application/xml" \ -H "authorization: Basic $template_instance_encrypted_credentials " \ " \


Stage 2 of the above workflow involves downloading the profile data from the source as an XML file, parsing the XML to remove id tags which may be different on the destination, checking that a profile with the same name as the one we just created does not yet exist on the destination instance, and then uploading the XML data using a POST request.Īfter we make changes, Stage 4 involves a similar process, but when the check for an existing profile comes back positive, issuing a PUT request to the endpoint with the same name.Īs in a shell script, this process would look something like this: Copy the amended profile to destination instances.Make changes to the profile in the template instance, such as alter a setting or change the scope.The profile is deployed to any computers in scope. Copy the new profile with the API to destination instances.
Configuration profiles may only be created in jamf pro pro#
Create a configuration profile in a template Jamf Pro instance, including some scope.It’s about a recent problem I encountered when copying configuration profiles from one instance to other instances using the API, and how I solved it. The script I use extends on the abilities of Jamf Migrator, a macOS application that can help copy endpoints from one source instance to one destination, to allow me to propagate items to all 30+ instances with a single command. I help manage over 30 Jamf Pro instances, and I use the API in scripts to duplicate items from a Template instance to all the customer instances. If you manage multiple Jamf Pro instances, you may be used to using the Jamf Pro “Classic” API to copy endpoints between them.
