Skip to content

Instantly share code, notes, and snippets.

View alecmeelan's full-sized avatar

Alec Meelan alecmeelan

  • New York
  • 23:53 (UTC -04:00)
View GitHub Profile
@alecmeelan
alecmeelan / Download and Install Jamf Connect.zsh
Last active November 8, 2024 19:59 — forked from talkingmoose/Download and Install Jamf Connect.zsh
Downloads and installs the latest available Jamf Connect software for Mac directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server every month.
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by: William Smith
Partner Program Manager
Jamf
[email protected]
https://gist.github.com/talkingmoose/94882adb69403a24794f6b84d4ae9de5
@alecmeelan
alecmeelan / jamfSetRecoveryLock.sh
Created October 10, 2024 14:24
This script automates the process of setting a Recovery Lock on a macOS device via Jamf Pro, leveraging API calls to authenticate, retrieve device information, and issue a lock command. It ensures security by invalidating the API token after execution and provides detailed output at each step for easy monitoring and troubleshooting. Generate the…
#!/bin/bash
# Step 1: Get the Jamf Pro URL
jssurl=$( /usr/bin/defaults read /Library/Preferences/com.jamfsoftware.jamf.plist jss_url )
echo "JSS URL: $jssurl"
# Step 2: API credentials (base64 encoded) are passed as parameter $4
apib64="$4"
# Recovery Lock Password is passed as parameter $5
@alecmeelan
alecmeelan / Location Information.zsh
Last active October 10, 2024 14:46 — forked from talkingmoose/Location Information.zsh
Add the following script to a Jamf Pro extension attribute to collect service provider location information based on public IP address when updating inventory.
#!/bin/zsh
# Get public IP address
publicIP=$( /usr/bin/curl http://ifconfig.io/ip \
--location \
--silent \
--max-time 10 )
# Check if public IP was retrieved
if [[ -z "$publicIP" ]]; then