This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
<<ABOUT_THIS_SCRIPT | |
----------------------------------------------------------------------- | |
Written by:William Smith | |
Professional Services Engineer | |
Jamf | |
bill@talkingmoose.net | |
https://gist.github.com/bd4abab222685c4e3781967a4d0491f6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
:<<ABOUT_THIS_SCRIPT | |
------------------------------------------------------------------------------- | |
Alert! This script will only work with Intel Macs. There is no secure automated | |
locally-initiated way to trigger an update or upgrade for Apple Silicon Macs. | |
Those require an MDM command be sent from their Mobile Device Management (MDM) | |
server. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
:<<ABOUT_THIS_SCRIPT | |
------------------------------------------------------------------------------- | |
Written by:William Smith | |
Partner Program Manager | |
Jamf | |
bill@talkingmoose.net | |
https://gist.github.com/6b78ba3fc4a6623dbc8225e2df38d570 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model information: https://support.apple.com/en-us/HT212551 | |
Published Date: June 24, 2022 | |
Verification: https://regex101.com/r/OozSRv/9 | |
1) Regex matches major identifier — Matches major model identifier numbers based on Apple's knowledge base article (more accurate): | |
(^Mac1[34]|MacBook(10|9)|MacBookAir(10|[7-9])|Macmini[7-9]|MacPro[6-7]|iMacPro1|iMac(1[6-9]|2[0-2])),\d|MacBookPro1(1,[45]|[2-8],\d) | |
2) Regex matches current or higher — Matches model identifiers based on Apple's knowledge base article and may match higher versions before this regex is updated (more future-proof). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################################### | |
# There is also an alternative way of running jq JSON parser, without installing the whole brew suite | |
# You can download the jq binary here: https://techstoreon.com/files/jq-osx-amd64 | |
# Pre-load it to each mac via the policy and store it somewhere (in /var for example) and just point your script to it | |
# every time jq needs to be used | |
########################################################################################### | |
#!/bin/bash | |
# Checks if jq is not already present, and if not - installs brew via script, then installs/loads jq JSON parser | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################################################################################################################################################################## | |
########################################################################################################################################################################## | |
# Please note: this script requires jq JSON parser to be installed on the mac, otherwise the script won't work | |
# You can install jq JSON parser using brew by running this script, which will install brew and jq automatically (non-interactive): | |
# https://gist.github.com/shurkin18/62ec34967794a32f9d63615db881ab5c | |
# | |
# There is also an alternative way of running jq JSON parser, without installing the whole brew suite | |
# You can download the jq binary here: https://techstoreon.com/files/jq-osx-amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# new user account details | |
username="lapsadmin" | |
displayName="LAPS Admin" | |
password="P@55w0rd" | |
admin="yes" | |
hidden="yes" | |
# determine next available UID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# list all users with UIDs above 501 | |
usersList=$( /usr/bin/dscl . -list /Users uid | /usr/bin/awk '$2 >= 501 { print $1 }' ) | |
# test for admin | |
while IFS= read aUser | |
do | |
/usr/sbin/dseditgroup -o checkmember -u "$aUser" admin 1>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
enrollmentStatus=$( /usr/bin/defaults read '/Library/Preferences/EarlyAdopter.plist' Enrolled ) | |
echo "<result>$enrollmentStatus</result>" |
NewerOlder