Wednesday, September 3, 2008

Print Queue Analysis - Revisited

A few weeks ago, I mentioned that I was asked to assist with the monitoring of a print queue. I have now included that PowerGadget chart. Enjoy!

function Get-PrintQueue {
$Printers
= Get-WmiObject `
-Class Win32_PerfFormattedData_Spooler_PrintQueue `
-ComputerName 'PrintServer'`
-Filter 'Name <> "_Total"'

foreach ($Printer in $Printers) {
if($Printer.Jobs -gt 1) {
$obj
= New-Object psObject
$obj
| Add-Member NoteProperty Printer $Printer.Name
$obj
| Add-Member NoteProperty JobCount $Printer.Jobs
Write
-Output $obj}
}
}
$dt
= Get-Date -Format g
Get
-PrintQueue | Out-Chart `
-Title "PrintServer printer queues as of $dt" `
-Size 800,400 `
-gallery bar `
-LegendBox_Visible false `
-View3D_Enabled true `
-AllSeries_BarShape Cylinder `
-AllSeries_PointLabels_Visible true `
-AllSeries_Color Yellow `
-Output "\\WebServer\e$\Inetpub\Extranet\Departments\InfoSys\ClinApps\HIS-Print.png"

Resulting chart:

HISPrint

No comments: