Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
talkingmoose / Download and Install Mozilla Firefox.zsh
Last active August 27, 2024 18:39
Downloads and installs the latest available Mozilla Firefox for Mac software directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server. Includes an optional checksum for added security.
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/b99a43948c4784631e9ad60eb714c776
@talkingmoose
talkingmoose / Match Version Number or Higher.bash
Last active March 20, 2026 15:46
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
bill@talkingmoose.net
https://gist.github.com/2cf20236e665fcd7ec41311d50c89c0e
@talkingmoose
talkingmoose / Get App Install Date.zsh
Created April 10, 2020 18:19
Returns the installation date for an app installed uisng an Apple Installer package. In Terminal run /path/to/script /path/to/Bundle.app (drag the app into the window).
#!/bin/bash
# in Terminal run /path/to/script /path/to/Bundle.app
installedApp=$1
# get the app's bundle identifier
bundleID=$( /usr/bin/defaults read "$installedApp/Contents/Info.plist" CFBundleIdentifier )
# get the installation epoch date for the bundle identifier
installEpoch=$( /usr/sbin/pkgutil --pkg-info="$bundleID" | /usr/bin/grep "install-time" | /usr/bin/awk '{ print $2 }' )
@talkingmoose
talkingmoose / How to Support a Remote Workforce.md
Last active May 19, 2020 05:41
Resources from our April 2, 2020, webinar
@talkingmoose
talkingmoose / Location Information.zsh
Last active December 3, 2024 15:29
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
@talkingmoose
talkingmoose / Download and Install Zoom Client for Mac.zsh
Last active November 6, 2024 00:54
Downloads and installs the latest available Zoom Client for Mac software directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server. Includes an optional checksum for added security.
#!/bin/zsh
:<<'ABOUT_THIS_SCRIPT'
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/5336e69480d87014a4c2ea1d6ec0ea4e
@talkingmoose
talkingmoose / Add Computer to Static Group.bash
Created March 21, 2020 00:10
Prompts an administrator to choose a Jamf Pro static group and provide a computer serial number to add to that group.
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
userName="API-Editor"
password="P@55w0rd"
httpErrorCodes="200 Request successful
201 Request to create or update object successful
400 Bad request
@talkingmoose
talkingmoose / Generate Random Firmware Password.bash
Last active July 20, 2021 15:30
Generate a randome EFI firmware password for each Mac and store in Jamf Pro. Note: This will be completely visible to all Jamf Pro users whose permissions allow access to Computers. Create an extension attritute with the first script.
#!/bin/bash
function logresult() {
if [ $? = "0" ] ; then
echo "$1"
else
echo "$2"
exit 1
fi
}
@talkingmoose
talkingmoose / Delete Extension Attributes.bash
Last active March 19, 2020 05:03
Evaluates each macOS extension attribute in Jamf Pro and deletes it if A) extension attribute is disabled and B) Description includes "delete after" date that is older than today's date. Useful in conjunction with "Disable Extension Attributes.bash".
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
userName="API-Editor"
password="P@55w0rd"
httpErrorCodes="200 Request successful
201 Request to create or update object successful
400 Bad request
@talkingmoose
talkingmoose / Disable Extension Attributes.bash
Last active March 19, 2020 04:57
Takes a list of Extension Attribute names in a file and disables them. Adds a comment to each "2020-04-17 - OK to DELETE after this date if EA is still disabled.". Edit lines 4-9 with custom details. Useful in conjunction with "Delete Extension Attributes.bash"
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
userName="API-Editor"
password="P@55w04d"
# number of days from now that the extension attribute can be safely deleted because of non-use
deleteInDays="30"