Printer Setup

aburrow
Contributor

We've got approx 500 printers currently on a windows print server.

What I thought would be an "easy" solution.

  1. Export the printer info from the windows server to a csv.
  2. Create Printers on a Macintosh using the info. from step 1 above.
  3. Add them to Casper.

Not as "easy" as I first thought.

  1. Exporting the printer info. was pretty straight forward.
  2. I knew drivers would be missing and was prepared to manually sort that.
  3. Manually entering the PPD files for each printer. Is there some way I can leverage Add printer wizards ability to automatically select the correct PPD?

Is there a better way to do this? If I can script the process as much as possible that would make it easier and quicker now as well as into the future.

2 REPLIES 2

tkimpton
Valued Contributor II

your in luck!

Today we have a new printer server and i just did this. You will need to watch out for the eqtrans for i am using, its for a printer billing system called equitrac. just replace it for smb or cifs.

It first checks to see if the ppd is installed.

Its not perfect by all means but does what i want and i haven't had time to clean it up much.

#!/bin/bash

###########################################################################################################################################
#
#  Created By Tim Kimpton
#
#  6/3/2013
#
#  Version 1.0
#
# This is Used to 
# 
# 1. delete the printers installed
#
# 2. remap the printer if the driver exists
#
# 3. set the 0436 printer as the default
#
############################################################################################################################################

######################################################### Removing all printers ############################################################

lpstat -p | awk '{print $2}' | while read printer
do
echo "Deleting Printer:" $printer
lpadmin -x $printer
done

####################################################### Start to Add the printers ##########################################################

#  Add Creative 436

if [ -f /Library/Printers/PPDs/Contents/Resources/en.lproj/Xerox Color EX 550-560 ] ;then

/usr/sbin/lpadmin -p LDNPSM040024-pldnc0436 -E -v eqtrans://ldnpsm040024/pldnc0436 -P /Library/Printers/PPDs/Contents/Resources/en.lproj/Xerox Color EX 550-560 -D "LDNPSM040024-pldnc0436" -L "Creative" -o printer-is-shared=false

else echo "Driver Missing"

fi

# Add Library 350

if [ -f /Library/Printers/PPDs/Contents/Resources/en.lproj/Canon PS-GX200 PS Ver1.0 ] ;then

/usr/sbin/lpadmin -p LDNPSM040024-pldnc0350 -E -v cifs://ldnpsm040024.rufusleonard.hq/pldnc0350 -P /Library/Printers/PPDs/Contents/Resources/en.lproj/Canon PS-GX200 PS Ver1.0  -D "LDNPSM040024-pldnc0350" -L "Library" -o printer-is-shared=false

else echo "Driver Missing"

fi

# Add Mezzanine

if [ -f /Library/Printers/PPDs/Contents/Resources/en.lproj/Xerox WorkCentre7500Series(EFI) ] ;then

/usr/sbin/lpadmin -p LDNPSM040024-pldnc0437 -E -v cifs://ldnpsm040024.rufusleonard.hq/pldnc0437 -P /Library/Printers/PPDs/Contents/Resources/en.lproj/Xerox WorkCentre7500Series(EFI)  -D "LDNPSM040024-pldnc0437" -L "Mezzanine" -o printer-is-shared=false

else echo "Driver Missing"

fi

# Add Zepplin 4th

if [ -f /Library/Printers/PPDs/Contents/Resources/en.lproj/Canon CLC4040-H1 PS Ver2.0 ] ;then

/usr/sbin/lpadmin -p LDNPSM040024-pldnc0306 -E -v cifs://ldnpsm040024/pldnc0306 -P /Library/Printers/PPDs/Contents/Resources/en.lproj/Canon CLC4040-H1 PS Ver2.0 -D "LDNPSM040024-pldnc0306" -L "Zepplin 4thFloor" -o printer-is-shared=false

else echo "Driver Missing"

fi

# Add Large Format

if [ -f /Library/Printers/PPDs/Contents/Resources/en.lproj/Canon CLC4040-H1 PS Ver2.0 ] ;then

/usr/sbin/lpadmin -p PLDNC0237 -E -v udspooler://udspooler/udserver?ipaddress=10.10.10.94 -P /Library/Printers/EFI express/PPDs/EFI_UD_EX.ppd -D "PLDNC0237" -L "Basement Large Format" -o printer-is-shared=false

else echo "Driver Missing"

fi

#################################################### Setting the default printer ########################################################

# Check to see if the printer is installed first before trying to make it a default

if 

lpstat -p | grep "LDNPSM040024-pldnc0436" | awk '{print $2}'

then

lpadmin -d "LDNPSM040024-pldnc0436"

fi

exit 0

tkimpton
Valued Contributor II