Skip to content

Instantly share code, notes, and snippets.

@kdrwygvh
Last active September 13, 2019 13:28
Show Gist options
  • Save kdrwygvh/b5f611a8af2ffead7bd89a41624dc869 to your computer and use it in GitHub Desktop.
Save kdrwygvh/b5f611a8af2ffead7bd89a41624dc869 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "Enter an API User with Create Category Permissions:"
read apiUser
echo "Enter the Password for this API User:"
read -s apiPassword
echo "Enter your Full Jamf Pro URL (https://jamf.url.com):"
read -s jamfProURL
for categoryLetter in {A..Z}; do
curl -X "POST" "$jamfProURL/JSSResource/categories/id/0" \
-H 'Content-Type: application/xml' \
-u "$apiUser:$apiPassword" \
-d $'<?xml version="1.0" encoding="UTF-8"?>
<category>
<id>0</id>
<name>'"$categoryLetter"'</name>
<priority>9</priority>
</category>'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment