1825766 Members
2127 Online
109687 Solutions
New Discussion

deleting printers

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

deleting printers

I have an RP7410, HPUX-11.i. I want to delete all 174 printers without having to do them one at a time thru sam. How can I delete all the printers at once?
5 REPLIES 5
Pete Randall
Outstanding Contributor
Solution

Re: deleting printers

Jeff,

If you can get a list of the printers into a text file (perhaps with the lpstat command), all you have to do is:

for PRNTR in `cat printer_list`
do
removequeue -f -q $PRNTR
done


Pete

Pete
Pete Randall
Outstanding Contributor

Re: deleting printers

Jeff,

Or, if it's not an HPPI defined printer, replace the removequeue with

"lpadmin -x$PRNTR"


Pete

Pete
Sanjay_6
Honored Contributor

Re: deleting printers

Hi,

you can try this,

# for i in `/usr/bin/lpstat -a |awk '{print $1}'`
> do
> lpadmin -x $i
> done

Hope this helps.

Regds


Geoff Wild
Honored Contributor

Re: deleting printers

Remember, spooler must be shut first, so:
lpshut

for i in `ls /etc/lp/interface`
do
lpadmin -x$i
done


No space after -x

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Mark Ellzey
Valued Contributor

Re: deleting printers

Jeff,

I know this is probably after the fact, but you can do this in SAM. Select the first printer, scroll to the last, hold the shift key and select the last printer. Under 'Actions', select 'Remove'. All selected printers will be removed.

Regards,
Mark