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 | |
| ### | |
| # | |
| # Name: set-ea-value.sh | |
| # Description: This script is designed to leverage the API to manually | |
| # update the value of an EA on a computer record. Handy | |
| # for situations where you don't need information actively | |
| # pulled from a Mac but still want to set adhoc when needed. | |
| # Values for jamfserver, API credentials, EA ID, EA 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/bash | |
| nameString="$4" # What to put in a name string | |
| plistName="$5" # Name of the plist file (e.g., com.planetexpress.expendable.plist) | |
| plistPath="$6" # Path to plist file (e.g., /Users/Shared/Careerchips) | |
| currentDate=$(date +"%Y-%m-%d %H:%M:%S") # Creates date in format Jamf can use for date-based data type EA | |
| defaults write $plistPath/$plistName name "$nameString" # Double-duty: will make plist if doesn't exist, then write the value! | |
| defaults write $plistPath/$plistName date "$currentDate" # Date can be used in Jamf EA with "Date" data type. |
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
| randomsn() { | |
| managed_python3 -c "import string; from random import randint, sample; print('VM' + ''.join(sample((string.ascii_lowercase + string.digits),10)))" | |
| } |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>PayloadContent</key> | |
| <array> | |
| <dict> | |
| <key>PayloadDescription</key> | |
| <string>This profile allows vmware-tools-daemon to access Accessibility.</string> | |
| <key>PayloadDisplayName</key> |
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
| function checkJPSConnection { | |
| n=0 | |
| until [[ $n -ge 12 ]]; do | |
| checkAvailablity=$(${jamfBinary} checkJSSConnection) | |
| # Function exitStatus | |
| if [[ $checkAvailablity == *"${jps}"* ]]; then | |
| echo "${jps} is available, continuing..." | |
| break | |
| else | |
| echo "${jps} is unavailable at this time. Suspending until next interval..." |
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 | |
| ### | |
| # | |
| # Name: management-action-by-policy.sh | |
| # Description: This script is designed to run with policies to use | |
| # Management Action.app to send a push notification to | |
| # a managed Mac. | |
| # Use: 1- Add script to Jamf Pro server, and optionally add | |
| # parameter lables that match the parameters below. |
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
| curl -X POST -H 'Content-type: application/json' --data '{"username": "Clever Name Here","icon_emoji": ":fancy_cat:","text": "Hello, this is your daily reminder that a thing just happened!","channel": "XXXXxXXXx"}' https://hooks.slack.com/services/full/URL/of/configured/incomingwebhook |
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 | |
| ############################################################################### | |
| ################################## VARIABLES ################################## | |
| ############################################################################### | |
| dockutil=$(which dockutil) | |
| currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' ) |
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 -x | |
| deviceIDs=( | |
| # put jssIDs here for computers to remove | |
| # ex. 12345678 | |
| 0000 | |
| ) | |
| for id in "${deviceIDs[@]}"; do | |
| /usr/bin/curl -sku "apiuser":"apipass" -X PUT -H "content-type: text/xml" "https://yourjamfpro.jamfcloud.com/JSSResource/computers/id/{$id}" -d "<computer><general><remote_management><managed>false</managed></remote_management></general></computer>" |
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 -x | |
| deviceIDs=( | |
| # put jssIDs here for mobile devices to remove | |
| # ex. 12345678 | |
| 0000 | |
| ) | |
| for id in "${deviceIDs[@]}"; do | |
| /usr/bin/curl -sku "apiuser":"apipass" -X PUT -H "content-type: text/xml" "https://yourjamfpro.jamfcloud.com/JSSResource/mobiledevices/id/{$id}" -d "<mobile_device><general><managed>false</managed></general></mobile_device>" |