Difference between revisions of "Advanced Mac Configuration Topics"
m (Yet another minor correction)
m (Advanced Topics moved to Advanced Configuration Topics: "Advanced Topics" too general, this name applies to the entire wiki.)
Revision as of 11:36, 13 October 2008
Reimage a mac from an image using the command line asr
sudo asr restore --source /Volumes/Source/Image.dmg --target /Volumes/Destination --erase --noverify
Note: This ERASES the destination drive. It also skips verification (which Disk Utility forces you to do, thus adding 10-15 minutes to the imaging process). Verification is GOOD, but sometimes, when you're sure that the image is healthy and your destination drive is healthy, it can be a waste of time.
Refresh disk arbitration
Note: This may force disks that haven't mounted to mount.
Pushing Adobe CS via ARD
Note: This assumes you've created a disk image with the applications (from /Applications), and a disk image with the settings (in /Library/Application Support, as well as /Library/Preferences).
hdiutil attach /adobepro.dmg ditto -V /Volumes/adobepro /Applications hdiutil detach /Volumes/adobepro rm -rdfv /adobepro.dmg hdiutil attach /settings.dmg ditto -V /Volumes/settings /Library hdiutil detach /Volumes/settings rm -rdfv /settings.dmg
Mute or set volume via ARD
osascript -e "set volume 0"
Change the zero to another number to set the volume to a higher value. Zero is mute. This seems to be system wide. It also mutes the startup chime. Good for classrooms. If headphones are plugged in, they have a separate volume setting.
Make Macs Speak via ARD
say "I hate Macs"
Set the Open Firmware password via ARD
Note: You need our Open Firmware package for this! It should be on our Mac server.
sudo ofpassword set blahblah123
Connect to an AFP server from the command line
sudo mkdir /Volumes/myserver sudo mount_afp afp://username:password@servername/sharename /Volumes/myserver
Run an ASR server
sudo asr -source /Volumes/Images/image.dmg -server /path/to/config.plist
Restore a client from an ASR server
sudo asr -source asr://serverip -targer /Volumes/Volume -erase -noverify
Enable ARD remotely
e.g. via SSH
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -access -on -users admin -privs -all
If nothing's been enabled, the full line should look like: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users admin -privs -all -restart -agent -menu
Update Symantec AntiVirus
LiveUpdate -update LUal -liveupdatequiet YES -liveupdateautoquit YES
LiveUpdate tends to be in the root library support folder: /Library/Application\ Support/Norton\ Solutions\ Support/LiveUpdate/LiveUpdate.app/Contents/MacOS/LiveUpdate -update LUal -liveupdatequiet YES -liveupdateautoquit YES
diskutil enableJournal /
Printers: Install, delete, set as default
lpadmin -p printer_name -E -v lpd://server/printer -P path-to-ppd.gz
- An example with a compressed ppd:
lpadmin -p printer_name -E -v lpd://server/printer -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4050\ Series.gz
- Or an uncompressed ppd:
lpadmin -p printer_name -E -v lpd://server/printer -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4050\ Series.ppd
Must be followed by
lpadmin -x printer_name
lpadmin -x AdobePDF7
Set as default
lpadmin -d printer_name
Install but disable sharing and add description
lpadmin -p printer_name -E -v lpd://server/printer -D "Room AB123" -P ppdpath -o printer-is-shared=false
On HP printers this should suffice:
lpadmin -p prntr -E -v lpd://srv/prnt -D "rmnr" -P "ppdpath" -o "HPOption_Duplexer=True" -o Duplex=DuplexNoTumble
On other models you can try listing the available printer options, then pass the appropriate option to lpadmin using the "-o" parameter. To list all available printer options, install the printer on any one workstation and then run:
lpoptions -p printer_name -l
For an HP laserjet the above command gives two options related to duplexing: HPOption_Duplexer and Duplex -- so those are the parameters passed using "-o" in the example above.
Desirable ARD commands
- Set disk permissions. Ignore permissions.
- Add ACLS for folders
- Run login permission script
- unbind/rename/rebind/rescan/apply proper admin privs.
- login items fix