This file contains hidden or 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 | |
# server connection information | |
URL="https://talkingmoose.jamfcloud.com" | |
username="api-editor" | |
password="P@55w0rd" | |
# provide the Jamf Pro ID of the PreStage Enrollment; look in the URL when viewing the PreStage Enrollment | |
mobileDeviceID="15" |
This file contains hidden or 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 hidden or 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 | |
[email protected] |
This file contains hidden or 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/sh | |
# -H = LDAP URI | |
# -x = use simple authentication instead of SASL | |
# -b = search base | |
# -D = user principal name (UPN) of authenticating user | |
# -w = password of authenticating user | |
# look up a user's manager's distinguished name |
This file contains hidden or 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 | |
[email protected] | |
https://gist.github.com/e9ed319226c6da30dd633725e48a97b0 |
This file contains hidden or 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 hidden or 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 | |
# list of known network services that should be excluded from results | |
defaultNetworkServices="An asterisk (*) denotes that a network service is disabled. | |
USB-C Dock Ethernet | |
Apple USB Ethernet Adapter | |
Wi-Fi | |
iPhone USB | |
Bluetooth PAN | |
Thunderbolt Bridge" |
This file contains hidden or 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>" |
This file contains hidden or 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 | |
# get name of currently logged in user | |
currentUser=$( /usr/bin/stat -f "%Su" /dev/console ) echo "Current user is $currentUser." | |
# get current user's home folder | |
homeFolder=$( /usr/bin/dscl . read "/Users/$currentUser" NFSHomeDirectory | /usr/bin/awk -F ": " '{ print $2 }' ) | |
# remove account by description name from Accounts sqlite database | |
/usr/bin/sqlite3 "$homeFolder/Library/Accounts/Accounts4.sqlite" 'DELETE FROM ZACCOUNT WHERE ZACCOUNTDESCRIPTION = "Exchange"' |