Skip to content

Instantly share code, notes, and snippets.

@poundbangbash
Created May 22, 2015 03:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poundbangbash/636c7098c7da21d6a8e5 to your computer and use it in GitHub Desktop.
Save poundbangbash/636c7098c7da21d6a8e5 to your computer and use it in GitHub Desktop.
Allow AD user to Remote Management
username=INSERTUSERNAMEHERE
# Check the username has been set
if [ $username = INSERTUSERNAMEHERE ]
then
echo You need to set the username
exit 1
fi
# Create the ARD Interact group which allows Control and Observe
dseditgroup -n /Local/Default com.apple.local.ard_interact
if [ $? != 0 ]
then
echo "com.apple.local.ard_interact group does not exist. Creating"
dseditgroup -n /Local/Default -o create com.apple.local.ard_interact
else
echo "com.apple.local.ard_interact group already exists"
fi
# Add the AD user to com.apple.local.ard_interact
echo "Adding user $username to com.apple.local.ard_interact"
dseditgroup -n /Local/Default -o edit -a $username -t user com.apple.local.ard_interact
# Add the AD user is a member of com.apple.local.ard_interact
echo "Verifying $username is a member of the com.apple.local.ard_interact"
dseditgroup -n /Local/Default -o checkmember -m $username com.apple.local.ard_interact
# Flush the DirectoryService member cache
dsmemberutil flushcache
# Restart ARDAgent
echo Restarting ARDAgent. The remote task will now hang--feel free to cancel the task.
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment