In an effort to automate the addition of a firewall exception for the latest version of Apple Remote Desktop, I found a way to use the defaults write command in the Terminal to create the rule without using the System Preferences panel. Below is an example of the command I used; in this case to add the ARD exceptions.
defaults write /Library/Preferences/com.apple.sharing.firewall
firewall -dict-add 'Apple Remote Desktop' '<dict><key>editable</key>
<integer>0</integer><key>enable</key><integer>1</integer><key>port</key>
<array><string>5900-5902</string><string>3283</string></array></dict>'
The only problem I encountered with this method is that the defaults command tends to change the ownership of the com.apple.sharing.firewall file from -rw-r--r-- root admin, which also disables the firewall. Changing the permissions back and rebooting will reactivate the built-in firewall.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050405142113281