Figuring out Available Printer Options in the Command Line

A few months ago I was trying to automate the addition of a specific printer on all our managed computers.  To do this I used the “lpadmin” command but ran into an issue figuring out what default options were available for that printer object.  I could use the GUI to figure out some, but I then didn’t know how to represent those option settings in the command line.  Finally, I found the “lpoptions” command.
I found it most useful to create the printer manually once without any options using the computers GUI.  Then you can issue the following command to get a list of options available in the ppd for that printer.  So, if I created a printer called “HelloDolly” I would issue the command:
The output from this is a list of options you can use in the lpadmin command when you automate the installation of this printer on other machines. But, the output from this command can look a little crazy.  What you need to do is look through the list and figure out which option you want (May require some trial and error). Once you pick the option you want just use the part before the slash as the option, then an “=”, then the value that you want for that option from the list to the right of the colon.
So, if the output from the command above had an entry like:
XROutputColor/XROutputColor: Unspecified PrintAsColor *PrintAsGrayscale
Then I could have an option in my lpadmin command to set the default output color for that printer.  The command with the option would look something like:

There you have it.  Now you can figure out all the default options available to your printer object so you can automate the setting of default options.




Interested In A Free Installer?

Our custom Wifi On/Off script has been a popular post!
This script automatically turns off the wireless interface on a computer when it is connected to a wired network, and turn the wireless interface back on when it is disconnected from the wired network.
This script has two main benefits:
  1. Network connection failover
  2. Eliminates unnecessary wireless traffic, and Multi-homed computers.
We are now offering a pkg installer for this script to anyone that signs up for our mailing list.