Skip to content

Instantly share code, notes, and snippets.

Created January 14, 2016 11:43
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Control ARD scripts
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki export PATH
# this will run as a munki install_check script
# exit status of 0 means install needs to run
# exit status not 0 means no installation necessary
# adapted scripts from here:
# we need to check wether ARD is running
ardrunning=$(ps ax | grep -c -i "[Aa]rdagent")
if [[ $ardrunning -eq 0 ]]; then
echo "ARD not running"
exit 0
# All Users access should be off
all_users=$(defaults read /Library/Preferences/ ARD_AllLocalUsers 2>/dev/null)
if [[ $all_users -eq 1 ]]; then
echo "All Users Access Enabled"
exit 0
# and wether the labadmin account is privileged
ard_admins=$(dscl . list /Users naprivs | cut -d ' ' -f 1)
if [[ $ard_admins != *clientadmin* ]]; then
echo "labadmin no ARD admin"
exit 0
echo "everything looks great"
exit 1
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki export PATH
# use kickstart to enable full Remote Desktop access
# for more info, see:
#enable ARD access
$kickstart -configure -access -on -users clientadmin,localadmin -privs -all
$kickstart -configure -allowAccessFor -specifiedUsers
$kickstart -activate
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment