Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
### ACTIVE DIRECTORY USER PERMISSIONS SCRIPT ###
### by Graham Pugh
### Props to Jeff Kelley, Graham Gilbert and various others for elements of script
### This script looks at the "Allow Administration By" field of the
### `dsconfigad -show` command and checks each of the Active Directory users
### with mobile accounts on the computer to check whether they should have
### local admin rights. It amends each user's membership of the local
#!/bin/sh
#fix for custom guest login keychain errors
LOGGER="/usr/bin/logger"
GID=`id -g`
if [[ ${GID} == 201 ]]; then
$LOGGER -s -t fix.guest.keychain.sh "Current user is guest. Creating a login.keychain" 1>&2
security create-keychain -p "" login.keychain
security login-keychain -s ~/Library/Keychains/login.keychain