Last active
September 13, 2019 13:28
-
-
Save kdrwygvh/b5f611a8af2ffead7bd89a41624dc869 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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