Skip to content

Instantly share code, notes, and snippets.

View jhbush's full-sized avatar

Jason Bush jhbush

  • Coffee Cats Consulting
  • San Francisco Bay Area
  • 03:43 (UTC -08:00)
  • X @jasonhbush
View GitHub Profile
@jhbush
jhbush / Set Computer PreStage Scope.bash
Created April 20, 2021 21:14 — forked from talkingmoose/Set Computer PreStage Scope.bash
As of Jamf Pro 10.14, the Jamf Pro API (/uapi) allows access to create and update scopes for computer PreStage Enrollments. Edit the information at the top and include a list of computer serial numbers for the COMPLETE scope. (The script replaces the scope list; it doesn't update.) Be sure to leave the opening and closing parentheses.
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
username="API-Editor"
password="P@55w0rd"
# provide the Jamf Pro ID of the PreStage Enrollment; look in the URL when viewing the PreStage Enrollment
prestageID="1"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>ManagedClient logging</string>
<key>PayloadEnabled</key>
@jhbush
jhbush / import_departments_into_jss.sh
Created June 20, 2019 15:22 — forked from neilmartin83/import_departments_into_jss.sh
Import a list of Departments into your JSS from a text file
#!/bin/sh
# Import a text file containing a list of Departments into your JSS!
# The text file must be formatted with Unix (LF) line breaks
# Important note: if your text file contains & characters, replace them with &amp;
# Change these for your environment
user="jssuser"
pass="jsspass"
jssurl="https://my.jss.org:8443"
import base64
import getpass
import sys
import xml.etree.ElementTree as Et
import urllib
import urllib2
reload(sys)
sys.setdefaultencoding('utf-8')
@jhbush
jhbush / catalogUtilities.py
Created April 17, 2018 20:48 — forked from Piker-Alpha/catalogUtilities.py
Show and set the CatalogURL on macOS 10.10 and greater
#!/usr/bin/python
import objc
from Foundation import NSBundle, NSClassFromString
SeedingBundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/Seeding.framework')
functions = [
('currentCatalog', '@'),
@jhbush
jhbush / unenrollFromSeedingProgram.py
Created April 17, 2018 20:47 — forked from Piker-Alpha/unenrollFromSeedingProgram.py
Python implementation of: seedutil unenroll
#!/usr/bin/python
''' Python implementation of "seedutil unenroll" '''
import os
import objc
from Foundation import NSBundle, NSClassFromString
SeedingBundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/Seeding.framework')
@jhbush
jhbush / enrollInSeedProgram.py
Created April 17, 2018 20:47 — forked from Piker-Alpha/enrollInSeedProgram.py
Python implementation of: seedutil enroll <program>
#!/usr/bin/python
''' Python implementation of "seedutil enroll <program>" '''
import os
import objc
from Foundation import NSBundle, NSClassFromString
SeedingBundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/Seeding.framework')
@jhbush
jhbush / forcefully_remove_mdm_1013.sh
Created December 22, 2017 01:45 — forked from opragel/forcefully_remove_mdm_1015.sh
forcefully_remove_mdm_1013.sh
#!/bin/bash
# Seriously there still apparently aren't enough warning labels
# If you don't understand the consequences don't do it
# ################
# #### May cause 10.13.2+ machines that were DEP-enrolled to not be considered as such
# ################
# but really, you shouldn't do this
# one local user enabled for MDM come on apple
# ¯\_(ツ)_/¯
@jhbush
jhbush / gist:08e3a8a7adbab390c11fc4311b179d20
Created November 13, 2017 07:07 — forked from rtrouton/gist:3ac68ac3770ab23ebae354c581f526b7
MigrateADMobileAccountToLocalAccount.command script
#!/bin/bash
# Modified 2/7/2017
Version=1.2
# Original source is from MigrateUserHomeToDomainAcct.sh
# Written by Patrick Gallagher - https://twitter.com/patgmac
#
# Guidance and inspiration from Lisa Davies:
# http://lisacherie.com/?p=239
#
# Modified by Rich Trouton
@jhbush
jhbush / uninstall_office_2016.sh
Created November 8, 2017 23:14 — forked from pirafrank/uninstall_office_2016.sh
Uninstall Office 2016 from OS X completely
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo -e "
ROOT PRIVILEDGES NEEDED!
You have to run this script as root.
Aborting...
"
exit 1
else