Posted on 03-07-2013 10:01 PM
We've got approx 500 printers currently on a windows print server.
What I thought would be an "easy" solution.
Not as "easy" as I first thought.
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.
Posted on 03-08-2013 12:00 AM
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
Posted on 03-08-2013 01:06 AM
Bens method is better. Wish i looked at it earlier
http://macmule.com/2011/09/08/how-to-map-drives-printers-based-on-ad-group-membership-on-osx/