sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
The commands in this article work with Apple Remote Desktop 3.2 and later.
Restart the ARD Agent and helper:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
Turn on Remote Desktop Sharing, allow access for all users, and enable the menu extra:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -allUsers -privs -all -clientopts -setmenuextra -menuextra yes
Turn on Remote Desktop Sharing, allow access for specified users:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -specifiedUsers
You must use the -configure, -access, and -privs options in a separate command to specify the set of users and their access privileges. For example, this command is for users with the short names "teacher" and “student." It gives them access to observe (but not control) the computer, and to send text messages:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users teacher,student -access -on -privs -ControlObserve -ObserveOnly -TextMessages
Unlike other kickstart options, you can’t combine the allowAccessFor options with other kickstart options. You must use it as in the last two samples above. You might have to call kickstart more than once to finish a computer’s setup. Remove access privileges for specified users ("student" in this example):
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users student -access -off
Disable ARD Agent and remove access privileges for all users:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off
@webknjaz
Fixed the original script.
Oh shit, you've got impressive work going man!Please excuse me for digging into your history. I've used cherrypy quite a bit in the past. I didn't realize you were a primary developer of ansible, that's sick!
Unless its a personal project you're working on, I'm surprised an org as large as redhat couldn't provide you with resources to test that :p That statement should be taken lightly/jokingly
I can't make any promises on this, but if you're able to wait I might be able to test it for you, if you'd like to work on it together. I have an old mac floating around that could use a bit of help with upgrading. I just have to find it first. I'd also like to get back into ansible, part of another effort I'm working on is slightly reinventing the wheel with regards to system management, and I think ansible has the right amount of customization through modules to achieve some of the more case specific needs.
Again I would need some time, I have more pressing priorities that need to be taken care of.
Let me know if that sounds interesting to you