Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
################################################################################
# Description:
# Adds or removes a computer (by Serial Number) to/from a static group
# in Jamf Pro using the OAuth 2.0 API with client credentials.
#
# Prerequisites:
# - Jamf Pro instance must support Bearer Token API authentication.
# - client_id and client_secret must belong to an API role with proper privileges.
# - API Privileges : Update Static Computer Groups, Read Static Computer Groups
@colorenz
colorenz / UpdateJamfStaticGroup.sh
Created May 17, 2025 08:22 — forked from karthikeyan-mac/UpdateJamfStaticGroup.sh
This script reads a list of serial numbers from a file and updates a Static Computer Group in Jamf Pro.
#!/bin/bash
#
# Script to update (add/remove) the existing Computer Static Group from the list of serial numbers.
# Karthikeyan Marappan
# API Role Privileges: Update Static Computer Groups
###################### CONFIGURABLE VARIABLES ################################
serialNumberList="$HOME/Desktop/sourceList.txt" # Path to plain text file with serial numbers
Jamf_URL="https://karthikeyan.jamfcloud.com" # Your Jamf Pro URL
Jamf_URL="${Jamf_URL%/}" # Remove trailing slash if present
#!/bin/zsh
## postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
# Optionally replace the value of this variable with the name of your organization.
organizationIdentifier=com.arekdreyer