Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
talkingmoose / Deploy Choices XML.zsh
Created May 5, 2023 15:33
This script when edited with the Apple Installer package name and app bundle identifier(s) will deploy a choices.xml file to exlude an installer choice during package installation.
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
[email protected]
https://gist.github.com/talkingmoose/3926e86332e32eb7d05a161c3f7e8f69
@talkingmoose
talkingmoose / Retrieve LAPS Password.zsh
Last active October 16, 2024 18:30
Retrieves the Jamf Pro LAPS password for the current computer. The script assumes a desktop administrator is operating the computer. The administrator will open Self Service, authenticate, and run the policy with the script.
#!/bin/zsh
# set -x
:<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
[email protected]
@talkingmoose
talkingmoose / Download and Install Microsoft product.zsh
Last active August 29, 2025 10:02
Downloads and installs the latest available Microsoft product specified 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/b6637160b65b751824943ede022daa17
@talkingmoose
talkingmoose / Ventura-compatible Macs (regex).txt
Created February 5, 2023 18:41
Regex looks for all Mac models compatible with macOS Ventura. May not be up-to-date with newly released models.
https://support.apple.com/en-us/HT213264
Published Date: October 24, 2022
Verification: https://regex101.com/r/nRkAFo/2
1) Exact regex — Matches major model identifier numbers based on Apple's knowledge base article (more accurate):
^(Mac(1[34]|BookPro1[4-8]|BookAir([89]|10)|Pro7|Book10)|iMac(Pro1|(1[89]|2[01]))|Macmini[89]),\d+$
2) Current or higher regex — Matches model identifiers based on Apple's knowledge base article and may match higher versions before this regex is updated (more future-proof).
@talkingmoose
talkingmoose / Jamf Pro Computer EraseDevice.zsh
Last active July 15, 2025 16:30
Use Jamf Pro Classic API to send EraseDevice command (Erase All Content and Settings on macOS Monterey and newer) to one or multiple computers by Jamf Pro ID. This script doesn't support computers locked using Device Lock with unique passcodes.
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
[email protected]
https://gist.github.com/d8dbdbc920cbaddd7d60f44f17bf268a
@talkingmoose
talkingmoose / Change Jamf Pro Activation Code.zsh
Created June 27, 2022 04:39
Programmatic method to change a Jamf Pro server's Activation Code via the Classic API for Jamf Pro 10.35.0 and later.
#!/bin/zsh
# server connection information
URL="https://jss.talkingmoose.net:8443"
userName="JSSAPI-Editor"
password="password"
# use base64 to encode credentials
encodedCredentials=$( printf "$userName:$password" | iconv -t ISO-8859-1 | base64 -i - )
@talkingmoose
talkingmoose / Speed Dating for Mac Admins.md
Last active April 9, 2025 19:07
Resources for my Penn State 2022 MacAdmins Campfire presentation on June 2

Speed Dating for Mac Admins

Terminal Login Banner

Last login: Wed Jun  1 23:03:39 on ttys000


                        'c.            Logged in as: bill.smith
                     ,xNMM.            ---------------------------------
@talkingmoose
talkingmoose / RemoveApplication.zsh
Created May 27, 2022 15:39
Remove a drag-and-drop application before performing another task such as a software update.
#!/bin/zsh
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]
https://gist.github.com/bd4abab222685c4e3781967a4d0491f6
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
[email protected]
https://gist.github.com/talkingmoose/15f055885b51cc8cb0bc7aad021acead
@talkingmoose
talkingmoose / RemoveUsersFromAdmin.zsh
Last active June 18, 2025 15:19
Removes all users with UIDs greater than 500 from local admin group.
#!/bin/zsh
# these local accounts will not be removed from admins
# one account name per line; keep the beginning and closing quotes
exceptionsList="talkingmoose
bill.smith
oszein
jamfadmin"