Powershell Print service report RRS feed

  • Question

  • Dear all,

    I need your kindly help in order to create a report that contains the amount of print jobs per months per queue on a server that host 600 queues, for the moment I manage to setup printing logs on the event logs in order to get all jobs.

    at this point this is what I have construct:

    $Results = Get-WinEvent -FilterHashTable @{LogName="Microsoft-Windows-PrintService/Operational"; ID=307;} -ComputerName $Computer

    ForEach($Result in $Results){
      $ProperyData = [xml]$Result.ToXml()
      $PrinterName = $ProperyData.Event.UserData.DocumentPrinted.Param5
         $hItemDetails = New-Object -TypeName psobject -Property @{
          MachineName = $ProperyData.Event.UserData.DocumentPrinted.Param4
          PrinterName = $PrinterName
          TimeCreated = $Result.TimeCreated

        $aPrinterList += $hItemDetails


    #Output results to CSV file
    $aPrinterList | Export-Csv  $file

    $filc=gc $file

    FOr the moment I anly got to know how many jobs for the hold server, now I need to get the amount per queue.

    Thanks in advance for your help

    • Moved by Bill_Stewart Wednesday, December 12, 2018 5:17 PM This is not "scripts on demand"
    Friday, August 17, 2018 8:25 AM

All replies

  • You need to use "Group-Object"

    help group-object -online


    Friday, August 17, 2018 9:40 AM