Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I may be being dim, but after a search herein I have not found very much that has enlightened me as to how I might monitor the printer queues on a server and report back on any share names that have errors.

Replies are listed 'Best First'.
Re: Manage print queues in Win32
by idsfa (Vicar) on Jul 11, 2005 at 16:31 UTC

    (Since you said "share", I'm assuming you want a Windows solution.) Try Win32::Printer and Win32::Printer::Enum

    use Win32::Printer::Enum; use Win32::Printer::Enum qw( Jobs ); # Could also loop over list of servers ... my @printer = Printers(); foreach my $p (@printers) { @jobs = Jobs($p->{PrinterName}, 0, 1); print $p->{PrinterName}, " Queue:\n"; foreach my $j (@jobs) { print $j->{Document}, $j->{Status}, "\n"; } }

    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. -- Cyrus H. Gordon
      Hurrah! Getting close now . . . Thanks for your help BH (exAnonymous Monk)