├── .gitignore ├── Casper_EAs ├── file_count_usr_local │ ├── README.txt │ └── file_count_usr_local.sh ├── outset_version │ ├── README.txt │ └── outset_version.sh └── site_check │ ├── README.txt │ └── site_check.sh ├── DisableFDEAutoLogin ├── DisableFDEAutoLogin.sh ├── README ├── payload-free_package │ ├── Disable FDE Auto Login.pkg.zip │ └── Remove Disable FDE Auto Login.pkg.zip └── removeDisableFDEAutoLogin.sh ├── README ├── Uninstaller └── Remove Office 2011 │ └── removeOffice2011.sh ├── enable_external_network_adapter └── enable_external_network_adapter.sh └── update_enduser_jamf └── update_enduser_jamf.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /Casper_EAs/file_count_usr_local/README.txt: -------------------------------------------------------------------------------- 1 | This Extension Attribute will check the file count of /usr/local. During Yosemite upgrades files in /usr/local are moved and then put back in the end. If you have a high number (100000+) of files in /usr/local, the upgrade can take many hours. 2 | -------------------------------------------------------------------------------- /Casper_EAs/file_count_usr_local/file_count_usr_local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -d /usr/local ]; then 4 | filecount=$(/usr/bin/find /usr/local | wc -l | sed 's/ //g') 5 | fi 6 | 7 | echo "$filecount" -------------------------------------------------------------------------------- /Casper_EAs/outset_version/README.txt: -------------------------------------------------------------------------------- 1 | This Extension Attribute will check if Outset is installed and what version. Outset 2.0 added a --version argument. If a version pre 2.0.0 is installed, it will report 1.x is installed. -------------------------------------------------------------------------------- /Casper_EAs/outset_version/outset_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | osvers=$(sw_vers -productVersion | awk -F. '{print $2}') 4 | 5 | if [[ ${osvers} -lt 9 ]]; then 6 | echo "Outset Not Compatible" 7 | fi 8 | 9 | if [ -d /usr/local/outset ]; then 10 | version=`/usr/local/outset/outset --version` 11 | 12 | if [[ $version != "" ]]; then 13 | echo "$version" 14 | else 15 | echo "Outset 1.x Installed" 16 | fi 17 | 18 | else 19 | echo "Outset Not Installed" 20 | fi -------------------------------------------------------------------------------- /Casper_EAs/site_check/README.txt: -------------------------------------------------------------------------------- 1 | This Extension Attribute will check if a system is on-site or off-site based on whether it can ping your internal JSS. Using CheckSiteNetwork from CasperCheck (https://github.com/rtrouton/CasperCheck). -------------------------------------------------------------------------------- /Casper_EAs/site_check/site_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CheckSiteNetwork (){ 4 | 5 | # CheckSiteNetwork function adapted from Facebook's check_corp function script. 6 | # check_corp script available on Facebook's IT-CPE Github repo: 7 | # 8 | # check_corp: 9 | # This script verifies a system is on the corporate network. 10 | # Input: CORP_URL= set this to a hostname on your corp network 11 | # Optional ($1) contains a parameter that is used for testing. 12 | # Output: Returns a check_corp variable that will return "True" if on 13 | # corp network, "False" otherwise. 14 | # If a parameter is passed ($1), the check_corp variable will return it 15 | # This is useful for testing scripts where you want to force check_corp 16 | # to be either "True" or "False" 17 | # USAGE: 18 | # check_corp # No parameter passed 19 | # check_corp "True" # Parameter of "True" is passed and returned 20 | 21 | 22 | site_network="False" 23 | ping=`host -W .5 server_name_here.domain.com` 24 | 25 | # If the ping fails - site_network="False" 26 | [[ $? -eq 0 ]] && site_network="True" 27 | 28 | # Check if we are using a test 29 | [[ -n "$1" ]] && site_network="$1" 30 | } 31 | 32 | CheckSiteNetwork 33 | 34 | if [[ "$site_network" == "False" ]]; then 35 | echo "Off-site" 36 | fi 37 | 38 | if [[ "$site_network" == "True" ]]; then 39 | echo "On-site" 40 | fi 41 | 42 | exit 0 43 | -------------------------------------------------------------------------------- /DisableFDEAutoLogin/DisableFDEAutoLogin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | osvers=$(sw_vers -productVersion | awk -F. '{print $2}') 4 | 5 | if [[ ${osvers} -eq 7 ]]; then 6 | ENCRYPTION=`diskutil cs list | grep -E "Encryption Type" | sed -e's/\|//' | awk '{print $3}'` 7 | if [ "$ENCRYPTION" = "AES-XTS" ]; then 8 | echo "FileVault 2 is enabled. Disabling FDEAutoLogin." 9 | defaults write /Library/Preferences/com.apple.loginwindow DisableFDEAutoLogin -bool YES 10 | else 11 | echo "FileVault 2 is not enabled." 12 | fi 13 | fi 14 | 15 | if [[ ${osvers} -ge 8 ]]; then 16 | FDE=`fdesetup status | grep "Off"` 17 | if [ "$FDE" = "" ]; then 18 | echo "FileVault 2 is enabled. Disabling FDEAutoLogin." 19 | defaults write /Library/Preferences/com.apple.loginwindow DisableFDEAutoLogin -bool YES 20 | else 21 | echo "FileVault 2 is not enabled." 22 | fi 23 | fi 24 | 25 | exit 0 -------------------------------------------------------------------------------- /DisableFDEAutoLogin/README: -------------------------------------------------------------------------------- 1 | When upgrading a FileVault2 enabled Mac to 10.10, automatic login should be disabled when installing additional packages at first boot. If automatic login is not disabled, the additional packages will be skipped over. Scripts are also available as payload-free packages. 2 | 3 | DisableFDEAutoLogin.sh disables automatic login when FileVault is enabled and should be applied before upgrading. 4 | 5 | removeDisableFDEAutoLogin.sh will re-enable automatic login and should be applied at the end of the upgrade process. 6 | -------------------------------------------------------------------------------- /DisableFDEAutoLogin/payload-free_package/Disable FDE Auto Login.pkg.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/golbiga/Scripts/4597d609327e4010a7d106245d15ed2c96c4d7bc/DisableFDEAutoLogin/payload-free_package/Disable FDE Auto Login.pkg.zip -------------------------------------------------------------------------------- /DisableFDEAutoLogin/payload-free_package/Remove Disable FDE Auto Login.pkg.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/golbiga/Scripts/4597d609327e4010a7d106245d15ed2c96c4d7bc/DisableFDEAutoLogin/payload-free_package/Remove Disable FDE Auto Login.pkg.zip -------------------------------------------------------------------------------- /DisableFDEAutoLogin/removeDisableFDEAutoLogin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | osvers=$(sw_vers -productVersion | awk -F. '{print $2}') 4 | DISABLEFDEAUTOLOGIN=`defaults read /Library/Preferences/com.apple.loginwindow DisableFDEAutoLogin 2>/dev/null` 5 | 6 | 7 | if [[ ${osvers} -ge 7 ]]; then 8 | if [ "$DISABLEFDEAUTOLOGIN" = "1" ]; then 9 | echo "Automatic login is disabled. Removing DisableFDEAutoLogin." 10 | defaults delete /Library/Preferences/com.apple.loginwindow DisableFDEAutoLogin 11 | else 12 | echo "Automatic login is not disabled." 13 | fi 14 | fi 15 | 16 | exit 0 -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/golbiga/Scripts/4597d609327e4010a7d106245d15ed2c96c4d7bc/README -------------------------------------------------------------------------------- /Uninstaller/Remove Office 2011/removeOffice2011.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | os=`sw_vers -productVersion | awk -F. '{print $1 "." $2}'` 4 | 5 | sudo rm -rf "/Applications/Microsoft Communicator.app" 6 | sudo rm -rf "/Applications/Microsoft Messenger.app" 7 | sudo rm -rf "/Applications/Microsoft Office 2011" 8 | sudo rm -rf "/Applications/Remote Desktop Connection.app" 9 | sudo rm -rf "/Library/Fonts/Microsoft" 10 | sudo rm -rf "/Library/Internet Plug-Ins/OfficeLiveBrowserPlugin.plugin" 11 | sudo rm -rf "/Library/Internet Plug-Ins/SharePointBrowserPlugin.plugin" 12 | sudo rm -rf "/Library/Internet Plug-Ins/SharePointWebKitPlugin.webplugin" 13 | sudo rm -rf "/Library/Application Support/Microsoft/Communicator" 14 | sudo rm -rf "/Library/Application Support/Microsoft/MAU2.0" 15 | sudo rm -rf "/Library/Application Support/Microsoft/MERP2.0" 16 | sudo rm "/Library/Preferences/com.microsoft.office.licensing.plist" 17 | sudo rm "/Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist" 18 | sudo rm "/Library/PrivilegedHelperTools/com.microsoft.office.licensing.helper" 19 | 20 | 21 | if [ $os = "10.6" ] || [ $os = "10.7" ] 22 | then rm -f "/var/db/receipts/com.microsoft.office*" "/var/db/receipts/com.microsoft.oc*" "/var/db/receipts/com.microsoft.mau*" "/var/db/receipts/com.microsoft.merp*" 23 | else 24 | if [ $os = "10.5" ] 25 | then rm -rf "/Library/Receipts/Office2011_en_*" 26 | fi 27 | fi 28 | -------------------------------------------------------------------------------- /enable_external_network_adapter/enable_external_network_adapter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Checks to see if the Mac is a rMBP, MacBook Air, or MacBook 3 | # If it's any of these machines, the script will then check for External Network Adapters 4 | # If an adapter is present, it will add the adapter to network services 5 | # Resolves an issue with USB & Thunderbolt Ethernet adapters with DeployStudio & Casper Imaging 6 | # Note: For MacBook 8,1 I'm using http://www.amazon.com/Plugable-Gigabit-Ethernet-Chromebook-Specific/dp/B003VSTDFG 7 | 8 | macbook_check=`/usr/sbin/system_profiler SPHardwareDataType | awk '/Model Name/' | awk -F': ' '{print substr($2,1,7)}'` 9 | usbAdapter=`/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: USB Ethernet"` 10 | usbGigAdapter=`/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: USB Gigabit Ethernet"` 11 | tbAdapter=`/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Thunderbolt Ethernet"` 12 | 13 | /usr/sbin/networksetup -detectnewhardware 14 | 15 | if [ "$macbook_check" = "MacBook" ]; then 16 | if [ "$usbAdapter" != "" ]; then 17 | /usr/sbin/networksetup -createnetworkservice USB\ Ethernet 'USB Ethernet' 18 | echo "USB Ethernet added to Network Services" 19 | else 20 | echo "No USB Adapter connected" 21 | fi 22 | if [ "$usbGigAdapter" != "" ]; then 23 | /usr/sbin/networksetup -createnetworkservice USB\ Gigabit\ Ethernet 'USB Gigabit Ethernet' 24 | echo "USB Gigabit Ethernet Adapter added to Network Services" 25 | else 26 | echo "No USB Gigabit Ethernet Adapter connected" 27 | fi 28 | if [ "$tbAdapter" != "" ]; then 29 | /usr/sbin/networksetup -createnetworkservice Thunderbolt\ Ethernet 'Thunderbolt Ethernet' 30 | echo "Thunderbolt Ethernet added to Network Services" 31 | else 32 | echo "No Thunderbolt Adapter connected" 33 | fi 34 | else 35 | echo "This machine does not use external network adapters" 36 | fi 37 | 38 | exit 0 -------------------------------------------------------------------------------- /update_enduser_jamf/update_enduser_jamf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script checks who is logged into the machine and updates username in JSS. 3 | 4 | # Who is logged in and what type of account is it 5 | loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'` 6 | 7 | if [ $loggedInUser = "root" ]; then 8 | echo "No one is logged in" 9 | exit 1 10 | else 11 | echo "Running recon for $loggedInUser `date`..." 12 | # Run recon, submitting the users username which as of 8.61+ can then perform an LDAP lookup 13 | sudo jamf recon -endUsername $loggedInUser 14 | echo "Finished running recon for $loggedInUser `date`..." 15 | fi 16 | exit 0 --------------------------------------------------------------------------------