Skip to content

Instantly share code, notes, and snippets.

Avatar

William Smith talkingmoose

View GitHub Profile
@talkingmoose
talkingmoose / Big Sur-compatible Macs (regex).txt
Last active Nov 4, 2020
Regex looks for all Mac models compatible with macOS Big Sur. May not be up-to-date with newly released models.
View Big Sur-compatible Macs (regex).txt
Model information: https://www.apple.com/macos/big-sur-preview/
Published Date: June 22, 2020
Verification: https://regex101.com/r/7nnq4T/5
(MacBookAir[6-9]|MacBookPro1[0-6]|MacPro[6-7]|MacBook(10|9|8)|Macmini[7-8]|MacPro[6-7]|iMacPro1),\d|iMac(14,4|(1[5-9]|20),\d)
pattern matches:
View "Scripting 201 for Apple Admins" Webinar
Resources for Jamf's "Script 201 for Apple Admins" webinar on June 18, 2020.
"Scripting 101 for Apple Admins" Webinar
Video: https://www.jamf.com/resources/webinars/scripting-101-for-apple-admins/
Discussions: https://www.jamf.com/jamf-nation/discussions/32391/scripting-101-for-apple-admins-webinar
PDF reference: https://www.jamf.com/blog/scripting-basics-for-everyone/
Time Zone script:
https://www.jamf.com/jamf-nation/third-party-products/files/836/settimezone-sh-set-the-time-zone
@talkingmoose
talkingmoose / Another Rename Computer Script.bash
Last active Jul 7, 2020
Jamf, Catalina and osascript compatible. Prompts to choose a site and enter an asset tag before renaming the Mac and then updating Jamf Pro.
View Another Rename Computer Script.bash
#!/bin/sh
# wait until the Dock process has started
while [[ "$setupProcess" = "" ]]
do
echo "Waiting for Dock"
setupProcess=$( /usr/bin/pgrep "Dock" )
sleep 3
done
@talkingmoose
talkingmoose / Download and Install Mozilla Firefox.zsh
Last active Dec 2, 2020
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.
View Download and Install Mozilla Firefox.zsh
#!/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 Nov 17, 2020
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.
View Match Version Number or Higher.bash
#!/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 Apr 10, 2020
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).
View Get App Install Date.zsh
#!/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
Resources from our April 2, 2020, webinar
View How to Support a Remote Workforce.md
@talkingmoose
talkingmoose / Location Information.zsh
Last active Oct 24, 2020
Add the following script to a Jamf Pro extension attribute to collect service provider location information based on public IP address when updating inventory.
View Location Information.zsh
#!/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 Jul 7, 2020
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.
View Download and Install Zoom Client for Mac.zsh
#!/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 Mar 21, 2020
Prompts an administrator to choose a Jamf Pro static group and provide a computer serial number to add to that group.
View Add Computer to Static Group.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
You can’t perform that action at this time.