« Dealing with Microsoft Windows People is tiring | Main | MORE Apple Remote Desktop command - line tips »
Since I see this question come up regularly on various lists, I thought I'd push this out into the great Google database.
While Apple Remote Desktop is a fantastic GUI management tool, what a lot of people don't know, (because it's somewhat poorly documented) is that Apple Remote Desktop provides you with a couple of spiffy command - line tools, one that is just for Apple Remote Desktop, and one that works even if you don't use Apple Remote Desktop, namely kickstart and systemsetup.
Technorati Tags: Apple, Apple Remote Desktop, Command Line Tools, Mac OS X, Tech Support, Technology
Both of these are part of the Apple Remote Desktop client, so if your systems have the current client, version 2.2, you have them at your disposal. kickstart lives at: /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart and systemsetup lives at: /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup . Note that you may have three files: systemsetup, systemsetup-panther and systemsetup-tiger. systemsetup is actually a symlink to one of the other two, depending on the version of your OS as seen here:
ls -l /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/
total 2504
drwxr-xr-x 3 root wheel 102 Feb 21 13:41 ARDForcedViewer.app
-rwxr-xr-x 1 root wheel 46560 Feb 16 11:57 ARDHelper
drwxr-xr-x 3 root wheel 102 Feb 21 13:41 Remote Desktop Message.app
-rwxr-xr-x 1 root wheel 232816 Feb 16 11:54 build_hd_index
lrwxr-xr-x 1 root wheel 18 Feb 24 08:54 networksetup -> networksetup-tiger
-rwxr-xr-x 1 root wheel 189192 Feb 16 12:05 networksetup-panther
-rwxr-xr-x 1 root wheel 191028 Feb 16 12:06 networksetup-tiger
-rwxr-xr-x 1 root wheel 179620 Feb 16 11:55 sysinfocachegen
lrwxr-xr-x 1 root wheel 17 Feb 24 08:54 systemsetup -> systemsetup-tiger
-rwxr-xr-x 1 root wheel 219692 Feb 16 12:05 systemsetup-panther
-rwxr-xr-x 1 root wheel 203688 Feb 16 12:06 systemsetup-tiger
If you have Jaguar clients, you may have another version for that too on those boxes.
kickstart
kickstart is the primary command line interface with the Apple Remote Desktop client, so it isn't a CLI version of the Apple Remote Desktop administration application, but it can still give you some nice abilities. First, obviously, you have to have SSH running, otherwise, connecting to the remote system is going to be a bit hard. Secondly, you'll need to have an account that can use sudo on the remote system, otherwise doing anything with kickstart is effectively impossible. Unless you use sudo, you can't even get a help screen for kickstart, and unfortunately, there's no man page for kickstart, so you have to have sudo access.
You can do four basic operations with kickstart: Uninstall, Install, configure, and (re)start/stop the Apple Remote Desktop client processes.
- Uninstall
The -uninstall option allows you to uninstall at three levels:
-uninstall -prefs removes the Apple Remote Desktop preferences.
-uninstall -settings removes the Apple Remote Desktop access privileges that you may have set in System Prefernces or via kickstart.
-uninstall -files yanks all Apple Remote Desktop - related files. - Install
-install has one option, -install -package path <path to installer package>. You can also do this via the installer command at /usr/sbin/installer, and installer gives you more options.
- Configure
Since the configure options are how you set up the Apple Remote Desktop client, there's a few of them. I'm not going to detail them all, you can easily read the kickstart help page for that. But, you can:
Create Apple Remote Desktop users via -configure -users
Set the Apple Remote Desktop client to run at startup via -configure -activate, or disable this via -configure -deactivate.
Set the priviledges for a user via -configure -users <shortusername> -privs -<privilege>
Grant/Deny a user Apple Remote Desktop access via -configure -access -on/-off -users <shortusername>
Set the computer info fields via -configure -computerinfo -set1/2/3/4 -1/2/3/4 <text>
Set various client options via -configure -clientopts -<options> - (Re)start/stop
Stop Apple Remote Desktop via -stop
Restart Apple Remote Desktop components via -restart -agent/-console/-menu (Restart is a very handy way to get a wonky client to behave)
systemsetup
systemsetup is one that used to only work on Mac OS X Server, until someone realized that if Apple Remote Desktop could use it, there was a lot it could do without reinventing the wheel. systemsetup is really a command line way of setting a rather large chunk of what you can set in System Preferences. With systemsetup, you can:
- get/set the current date
- get/set the current time
- get/set the current time zone
- list the time zones supported by a client
- get/set the use of a network time server
- get/set the timeserver a client uses
- get/set the idle time until the computer/display/hard drive sleep (this gets all three values at once and sets all three to the same value)
- get/set the the idle time until the computer sleeps
- get/set the the idle time until the display sleeps
- get/set the until the hard disk sleeps
- get/set the wake on modem state
- get/set the wake on network access state
- get/set the restart on power failure state
- get/set the restart on freeze state
- get/set the allow power button to sleep computer state
- get/set the remote login state (ssh)
- get/set the remote Apple Events state
- get/set the computer name
- get/set the local subnet name
- get/set/list the startup disks for a client
- get/set the number of seconds a computer will wait to restart after a power failure
- get/set whether the enclosure lock on an Xserve enables/disables the keyboard
Hopefully, once this gets picked up by Google, it will help some folks out with dealing with Apple Remote Desktop from the command line, and reduce the number of n00b questions on this by a few.
