Skip to content

Instantly share code, notes, and snippets.

Avatar

William Smith talkingmoose

View GitHub Profile
@talkingmoose
talkingmoose / MegaPKGr.zsh
Last active Dec 1, 2020
The pkgbuild binary and Jamf Composer don't support adding single files of 8 GB or more to a package. Some apps like Install macOS Big Sur.app include files larger than 8 GB in their bundles. This script will create a deployable PKG file from apps whose bundles include those large files.
View MegaPKGr.zsh
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/e9ed319226c6da30dd633725e48a97b0
@talkingmoose
talkingmoose / Download and Install Microsoft product.zsh
Last active Nov 30, 2020
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.
View Download and Install Microsoft product.zsh
#!/bin/zsh
:<<'ABOUT_THIS_SCRIPT'
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/a16ca849416ce5ce89316bacd75fc91a
@talkingmoose
talkingmoose / Manage App Notifications.bash
Last active Nov 29, 2020
macOS Catalina will prompt users to allow Notifications from each app that makes a request. Administrators can manage these prompts using a Configuration Profile. If running Jamf Pro 10.19 or later, I suggest instead using this manifest: https://github.com/talkingmoose/jamf-manifests/blob/master/macOS%20Notifications%20(com.apple.notificationset…
View Manage App Notifications.bash
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/9faf50deaaefafa9a147e48ba39bb4b0
@talkingmoose
talkingmoose / Mac software updates.txt
Created Feb 9, 2020
For 1:1 devices where administrators need to encourage users to update software or macOS versions.
View Mac software updates.txt
IT is responsible for patch management, but users should be afforded the opportunity to install updates when convenient for them.
Communication is key. Where possible start with unobtrusive methods to notifiy users they need to install updates such as via email. In the email, include the deadline and a link to a policy to "update now". Use HTML formatting and graphics to help them understand what will happen and make the updates easy.
If email communications fail to get users to update, use a JamfHelper script in a policy to nag users once per day they need to update. Provide a button that links to the policy to "update now" and another button to "remind later". Users should not be able to close the nag until they click either of the buttons. Consider automatically closing the nag after 10 minutes and allowing the policy to reopen it at next checkin. After the user acknowledges the nag by clicking a button, write a time stamp to a file to prevent the nag from appearing the rest of the day. Alternatively, in
@talkingmoose
talkingmoose / Add Completed Tasks to Bear Daily Notes.scpt
Last active Nov 23, 2020
Copies titles of completed tasks in Things to current Daily Note in Bear and marks it as done. Save this AppleScript to the Scripts folder for Things at ~/Library/Scripts/Applications/Things and call it using the system-wide AppleScript menu.
View Add Completed Tasks to Bear Daily Notes.scpt
(*
----------------------------------------------------------------------------------
ABOUT THIS SCRIPT
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
@talkingmoose
talkingmoose / Foreground Application Usage.bash
Last active Nov 23, 2020
Calculate usage in hours for a specific application on a specific Mac using Jamf Pro Application Usage information.
View Foreground Application Usage.bash
#!/bin/bash
# server connection information
URL="https://jamfpro.talkingmoose.net:8443"
userName="api-auditor"
password="P@55w0rd"
# app and computer information
computerID="2"
startDate="2018-12-01"
@talkingmoose
talkingmoose / Send Jamf Pro Mobile Device Command via API.bash
Created Apr 9, 2019
Sample script for sending a remote management command to multple iOS devices via the Jamf Pro API.
View Send Jamf Pro Mobile Device Command via API.bash
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
userName="api-editor"
password="P@55w0rd"
command="UpdateInventory"
# XML data to upload
THExml="<mobile_device_command>
@talkingmoose
talkingmoose / jamfHelperProgress.sh
Last active Nov 23, 2020
Example for using JamfHelper to display progress during setup.
View jamfHelperProgress.sh
#!/bin/sh
/Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper \
-windowType fs \
-title "This is the title" \
-heading "This is the heading" \
-description "Completing Step 1 of 4" \
-icon /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/com.apple.cinema-display.icns &
sleep 2
@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 / Jamf Pro Provisioning 2.zsh
Created Nov 16, 2020
Runs when called by a Jamf Pro policy triggered by Enrollment Complete. Installs third party software that Apple's Volume Purchase Program (VPP) cannot install and runs maintenance routines (bind to Active Directory, set time zone etc.).
View Jamf Pro Provisioning 2.zsh
#!/bin/zsh
<<'ABOUT_THIS_SCRIPT'
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
You can’t perform that action at this time.