Skip to content

Instantly share code, notes, and snippets.

View TheRossRoss's full-sized avatar

TheRossRoss

View GitHub Profile
@talkingmoose
talkingmoose / Location Information.zsh
Last active March 29, 2023 19:42
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
# provide for Big Sur and earlier
xpath() {
# the xpath tool changes in Big Sur
if [[ $( /usr/bin/sw_vers -buildVersion) > "20A" ]]; then
/usr/bin/xpath -e "$@"
else
/usr/bin/xpath "$@"
fi
@arekdreyer
arekdreyer / postinstall-for-Composer-for-DEPNotify.zsh
Last active April 5, 2024 21:36
Postinstall script for Jamf Composer to install DEPNotify with supporting scripts and a LaunchDaemon
#!/bin/zsh
## postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
# This postinstall script for Composer creates the following
# A LaunchDaemon that starts a separate script to run a Jamf Pro policy command
@talkingmoose
talkingmoose / Enable all macOS software updates.bash
Last active May 31, 2024 08:45
The /Library/Preferences/com.apple.SoftwareUpdate.plist seems impervious to being managed via configuration profile (at least on macOS Mojave). While not enforced management, add this script to a Jamf policy and run it on a routine basis such as once per week on scoped Macs.
#!/bin/bash
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticCheckEnabled -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticDownload -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticallyInstallMacOSUpdates -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist ConfigDataInstall -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist CriticalUpdateInstall -bool TRUE
/usr/bin/defaults write /Library/Preferences/com.apple.commerce.plist AutoUpdate -bool TRUE
exit 0
@talkingmoose
talkingmoose / jamfHelperProgress.sh
Last active March 16, 2021 18:33
Example for using JamfHelper to display progress during setup.
#!/bin/sh
/Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper \
-windowType fs \
-title "This is the title" \
-heading "This is the heading" \
-description "Completing Step 1 of 4" \
-icon /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/com.apple.cinema-display.icns &
sleep 2