Operating System - HP-UX
1823198 Members
3701 Online
109648 Solutions
New Discussion юеВ

Re: Remove all printers from a system

 
SOLVED
Go to solution
Craig A. Sharp
Super Advisor

Remove all printers from a system

I need to remove all the printers on one of my servers and start out fresh by restoring the spooler from another system. I can do the restore of the spooler but I do not know how to remove all the printer at one time.

Thanks,

Craig
5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: Remove all printers from a system

Probably the easiest way is to use SAM.

Go into SAM -> Printers and Plotters -> LP Spooler -> Printers and Plotters

Once there just go down the list and select every printer on the list. If you are in the GUI, you must hold down the CTRL key as you click each printer. If you are in the TUI then you can just scroll with the arrows and hit the space bar to select each printer.

Once all are selected go up to the Actions menu and select Remove. It will then prompt you asking if you are sure you want to remove each printer. Say yes and each will be removed.
Helen French
Honored Contributor
Solution

Re: Remove all printers from a system

Hi,

Two options:

1) SAM -> Printer configuration ( select all printers and remove it)

2) lpadmin -xprinter_name

HTH,
Shiju
Life is a promise, fulfill it!
Mark Greene_1
Honored Contributor

Re: Remove all printers from a system

for PRINTER in `lpstat -a |cut -d" " -f1`; do
lpadmin -x $PRINTER
done

HTH
mark
the future will be a lot like now, only later
S.K. Chan
Honored Contributor

Re: Remove all printers from a system

Try this ..

# for P in `lpstat|grep \^printer|awk '{print $4}'`
> do
> lpadmin -x$P
> done
Craig A. Sharp
Super Advisor

Re: Remove all printers from a system

Got it....Here is my solution:

#!/usr/bin/perl -w

open (PRINTERS, "printers.out") || die "$!";

@printers = ;

foreach (@printers) {

system "lpadmin -x$_";

};

printers.out is a list of the printers extracted from the /etc/lp directory.

Thanks for your help.

Craig