Skip to content

Instantly share code, notes, and snippets.

@MichaelandMore
MichaelandMore / Set Computer PreStage Scope.bash
Last active November 14, 2023 02:18 — forked from talkingmoose/Set Computer PreStage Scope.bash
JAMF Pro API: This script removes a list of machines from one PreStage Enrollment and adds them to another
#!/bin/bash
#This script removes a list of machines from one PreStage Enrollment and adds them to another
#Checks are applied to see if all machines are able to move between these two PreStages as intended
#This should help keeping track
#
#standing on the shoulders of giants:
#https://community.jamf.com/t5/jamf-pro/creating-an-authorization-token-with-jamf-pro-api-help-would-be/m-p/186172
#https://developer.jamf.com/jamf-pro/reference/computer-prestages-1#put_v2-computer-prestages-id-scope
#https://gist.github.com/talkingmoose/327427d23b422000f9d17183f8ef1d22
###Thank you very much ####
@talkingmoose
talkingmoose / Match Version Number or Higher.bash
Last active July 13, 2025 17:27
Generates a regular expression (regex) that matches the provided version number or higher. Useful for Jamf Pro's "matches regex" operator in searches and smart groups where the results need to be the current version of an app or higher.
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]
https://gist.github.com/2cf20236e665fcd7ec41311d50c89c0e
@bruienne
bruienne / find32bit.py
Created January 25, 2018 17:08
Find 32-bit executables in a given path. Uses the macholib module that ships with macOS.
#!/usr/bin/python
from macholib import MachO
import macholib
import os
import sys
path = sys.argv[1]
for root, dirs, files in os.walk(path):
@gregneagle
gregneagle / fancy_defaults_read.py
Last active December 5, 2024 10:38
fancy_defaults_read.py: Reads a preference, prints its value, type, and where it is defined.
#!/usr/bin/python
import os
import sys
from CoreFoundation import (CFPreferencesAppValueIsForced,
CFPreferencesCopyAppValue,
CFPreferencesCopyValue,
kCFPreferencesAnyUser,
kCFPreferencesAnyHost,