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 | |
# (C) Andrew Worth Carson | |
# MIT License: https://andrewworthcarson.com/mit_license.html | |
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do | |
userHome=$(dscl . read /Users/"$user" NFSHomeDirectory | sed 's/NFSHomeDirectory://' | grep "/" | sed 's/^[ \t]*//') | |
appleid=$(dscl . readpl "${userHome}" dsAttrTypeNative:LinkedIdentity appleid.apple.com:linked\ identities:0:full\ name 2> /dev/null | awk -F'full name: ' '{print $2}') | |
if [[ "${appleid}" == "" ]]; then | |
echo "No AppleID for user:${user}" |
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
#!/usr/bin/python | |
# Libraries | |
import sys | |
import requests | |
import json | |
import re | |
# Constants | |
client_id = 'YOUR CLIENT ID HERE' |
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 | |
# (C) Andrew Worth Carson | |
# MIT License: https://andrewworthcarson.com/mit_license.html | |
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do | |
userHome=$(dscl . read /Users/"$user" NFSHomeDirectory | sed 's/NFSHomeDirectory://' | grep "/" | sed 's/^[ \t]*//') | |
if cp "${userHome}/Library/Application Support/Google/Chrome/Default/History" "/tmp/${user}-History"; then | |
if sqlite3 "/tmp/${user}-History" <<EOF | |
.headers on |
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 | |
# (C) Andrew Worth Carson | |
# MIT License: https://andrewworthcarson.com/mit_license.html | |
username=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') | |
if [[ "${username}" == "" ]]; then | |
echo "No user currently logged in." | |
exit 1 | |
else |
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 | |
# (C) Andrew Worth Carson | |
# MIT License: https://andrewworthcarson.com/mit_license.html | |
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do | |
userHome=$(dscl . read /Users/"$user" NFSHomeDirectory | sed 's/NFSHomeDirectory://' | grep "/" | sed 's/^[ \t]*//') | |
echo "$user:$userHome" | |
done |
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 | |
# This disables the Column View icon in Finder for all users | |
# Change file separators so we don't get hung up on spaces | |
OIFS=$IFS | |
IFS=$'\n' | |
# Iterate through all users | |
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do |
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 | |
# The goal of this script is to install a profile for each login user on a Mac | |
# device, taking into consideration the discrepancies between the profiles tool | |
# on High Sierra versus older versions. | |
# The should combine to create the absolute path of the profile | |
profileName='/test cert.mobileconfig' | |
profilePath='/Library/Addigy/ansible/packages/Certificate Test' |
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 | |
# (C) Andrew Worth Carson | |
# MIT License: https://andrewworthcarson.com/mit_license.html | |
APP="Google Chrome" | |
# Check if the app in question is running. | |
isRunning=$(ps aux | grep -v grep | grep "${APP}") | |
while [ "${isRunning}" != "" ]; do |
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/sh | |
#set -x | |
TOOL_NAME="Microsoft Office 2011 for Mac Removal Tool" | |
TOOL_VERSION="1.4" | |
## Copyright (c) 2017 Microsoft Corp. All rights reserved. | |
## Scripts are not supported under any Microsoft standard support program or service. The scripts are provided AS IS without warranty of any kind. | |
## Microsoft disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a | |
## particular purpose. The entire risk arising out of the use or performance of the scripts and documentation remains with you. In no event shall |
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 | |
# (C) Andrew Worth Carson | |
# MIT License: https://andrewworthcarson.com/mit_license.html | |
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do | |
userHome=$(dscl . read /Users/"$user" NFSHomeDirectory | sed 's/NFSHomeDirectory://' | grep "/" | sed 's/^[ \t]*//') | |
if [ "$(defaults read "${userHome}/Library/Preferences/com.apple.systemuiserver.plist" 2> /dev/null | grep -i user.menu)" == "" ]; then | |
touch "${userHome}/Library/Preferences/com.apple.systemuiserver.plist" | |
defaults write "${userHome}/Library/Preferences/com.apple.systemuiserver.plist" menuExtras -array-add '<string>/System/Library/CoreServices/Menu Extras/User.menu</string>' |