Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Automate printer setup with NetRestore's PHPServices Printers
I wanted a way to automatically set up a printer without having to touch the machine and after much work, I did it (with a little help from some friends). Here are the steps I used in order to get it to work. Your mileage may vary, and this isn't a post action, since some of the commands aren't included on a default NetBoot image. You'll need Mike Bombich's excellent NetRestore

First, log into NetRestore's PHP services, and go to Database administration » Create Machine Specific Attributes. Add these specific field names (spelling and case counts!). The following is laid out in this order: field name | Data type | Default value (if any)...
  • printer_name | VARCHAR(63) |
  • printer_location | VARCHAR(63) |
  • printer_driver | VARCHAR(128) |
  • printer_address | VARCHAR(21) | lpd://
Step two follows: Change the 'Machine Specific Settings for Machines' settings for the machines that you want the script to set up printers for.

Go to this URL...
replace 00:00:00:00:00:00 with your machine's MAC address. Enter in the data for that machine for the fields you just created. Spaces aren't allowed in the printer_name, printer_location, or printer_address fields. They are allowed in the printer_driver field. For the printer_driver field, find the right file name by going to /Library » Printers » PPDs » Contents » Resources » en.lproj. You'll find the correct printer driver in that folder. For example, the one I needed to add was called HP LaserJet 4200 Series.gz.

Now you're all set up on the server side.

Client side setup

Copy the code for these two scripts into separate files, as named below: Save these two files somewhere on your client machine; wherever you see fit. Make sure you also set the proper variables correctly in the file. Run from the client, and the printer should be installed. Since my machines are frozen, I have it set up to run this script every time the computer starts up, so that it adds the printer based my settings in NetRestore's PHP services page.

Good luck to the rest of you...
  • Currently 2.00 / 5
  You rated: 4 / 5 (6 votes cast)

Automate printer setup with NetRestore's PHPServices | 4 comments | Create New Account
Click here to return to the 'Automate printer setup with NetRestore's PHPServices' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automate printer setup with NetRestore's PHPServices
Authored by: iordonez on May 08, '07 09:50:05AM

OR you just add the printer into Work Group Manger which will allow you to manage printers in realtime with out restoring. If you have a Netrestore server there is a pretty good chance you have a Directory server installed also

Isaac Ordonez
[url=]Mac OS X Server Tips and Tricks[/URL]

[ Reply to This | # ]
Automate printer setup with NetRestore's PHPServices
Authored by: thehigherlife on May 08, '07 10:19:18AM

this doesn't require a restore in order to work. This just uses NetRestore's PHP services inorder to get the information on which printer to load. running the script at any time will result in the correct printer being added and made default.

[ Reply to This | # ]
Automate printer setup with NetRestore's PHPServices
Authored by: lucidsystems on Aug 20, '07 11:29:12PM
Or if you have a lot of printers, and are comfortable with the command line you can use PrinterSetup

[ Reply to This | # ]
Printer Package Deployment
Authored by: lucidsystems on Dec 19, '07 05:31:44PM

The latest version of PrinterSetup supports Apple Package deployment.

This feature allows the creation of Apple install packages which are able to install drivers and/or configure cups queues on Mac OS X systems.

[ Reply to This | # ]