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.
View Deploy Choices XML.zsh
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/3926e86332e32eb7d05a161c3f7e8f69
@talkingmoose
talkingmoose / Download and Install Zoom Client for Mac.zsh
Last active February 13, 2024 16:58
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 / 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.
View Ventura-compatible Macs (regex).txt
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 / Last Reboot.bash
Last active February 4, 2024 06:08
Jamf Pro extension attribute to return date of last reboot. Create the EA with a Data Type of 'date'. This allows a Smart Group to use greater than and less than calculations.
View Last Reboot.bash
#!/bin/bash
# get last reboot date and time
lastReboot=$( who -b )
# extract month, day and time
month=$( /usr/bin/awk '{ print $3 }' <<< "$lastReboot" )
day=$( /usr/bin/awk '{ print $4 }' <<< "$lastReboot" )
time=$( /usr/bin/awk '{ print $5 }' <<< "$lastReboot" )
@talkingmoose
talkingmoose / Manage App Notifications.bash
Last active January 25, 2024 15:26
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 / Download and Install VLC.zsh
Last active January 11, 2024 11:54
Downloads and installs the latest available VLC 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 VLC.zsh
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/84cbe002aca35c73032bccd230d8988a
@talkingmoose
talkingmoose / Create User Account.zsh
Last active December 13, 2023 14:52
Simple script to create a new macOS user account. Will not provide a SecureToken.
View Create User Account.zsh
#!/bin/zsh
# new user account details
username="lapsadmin"
displayName="LAPS Admin"
password="P@55w0rd"
admin="yes"
hidden="yes"
# determine next available UID
@talkingmoose
talkingmoose / Download and Install Microsoft product.zsh
Last active December 11, 2023 21:06
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
Partner Program Manager
Jamf
bill@talkingmoose.net
https://gist.github.com/b6637160b65b751824943ede022daa17
@talkingmoose
talkingmoose / Sonoma-compatible Macs (regex)
Last active December 10, 2023 17:14
Regex looks for all Mac models compatible with macOS Sonoma. May not be up-to-date with newly released models.
View Sonoma-compatible Macs (regex)
https://support.apple.com/en-us/HT213772
Published Date: November 15, 2023
Verification: https://regex101.com/r/GCfKMt/9
1) Exact regex — Matches major model identifier numbers based on Apple's knowledge base article (more accurate):
^(Mac(1[345]|BookPro1[5-8]|BookAir([89]|10)|Pro7)|iMac(Pro1|(19|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 / Create Event from Task\cmE.scpt
Created April 1, 2012 18:30
Outlook for Mac AppleScript to create an event from a task
View Create Event from Task\cmE.scpt
(*
Create Event from Task
Copyright (c) Microsoft Corporation. All rights reserved.
Modified by William Smith.
*)
tell application "Microsoft Outlook"