Eventing and Print Jobs

Hey all! I am attempting to write a script that will collect information about print jobs on a print server and write the data to a database. I am trying to get data on print job owner, printer name, whether it was color or grayscale, number of pages and
number of copies.
 I am running into a problem finding a method to collect events for print jobs. I have attempted to subscribe to creation and modification events of the Win32_PrintJob class, which is ok but doesn't seem very accurate about details like pages printed
and color/grayscale. I next attempted to respond to these events by using Get-WinEvent each time the event fires and then using the JobId property of the event to scan the PrintService log for matching 307 and 805 events. However, I have found that the Win32_PrintJob
JobId does not seem to match the document id in the event log entries.
I scrapped that idea and instead attempted to collect .NET events for the NTEventLog class but this only seems to work with the traditional logs such as system, security and application.
I suppose I could just scan the event logs on a regular basis and collect print job information that way, but I was really looking to collect and log this info in real time rather than just looping every so often. Has anyone else tried eventing for any of
these classes? Is it possible there is another .NET class I could subscribe to that would provide me with details of incoming print jobs? Am I going about this entirely the wrong way?
Thanks!

Hi Matt,
Maybe you can try the .NET class for printing:
Function Get-PrintJobs
<#
.SYNOPSIS
Return the list of jobs on the current printer
.DESCRIPTION
This function returns a list of pending jobs on the specified print server for a given queue
.PARAMETER ComputerName
Name of the print sever
.PARAMETER Name
Name of the print queue
.EXAMPLE
Get-PrintJobs -ComputerName ps -Name HPLJ5000
.LINK
http://scripts.patton-tech.com/wiki/PowerShell/PrintServerManagement#Get-PrintJobs
#>
Param
$ComputerName,
$Name
Begin
$Host.Runspace.ThreadOptions = "ReuseThread"
if ((Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture -eq '64-bit')
$SystemPrinting = Get-ChildItem "$($env:systemroot)\assembly\GAC_64\System.Printing"
$SystemPrintingFile = Get-ChildItem -Name "*system.printing*" -Recurse -Path $SystemPrinting.FullName
$SystemPrintingFile = "$($SystemPrinting.FullName)\$($SystemPrintingFile)"
else
$SystemPrinting = Get-ChildItem "$($env:systemroot)\assembly\GAC_32\System.Printing"
$SystemPrintingFile = Get-ChildItem -Name "*system.printing*" -Recurse -Path $SystemPrinting.FullName
$SystemPrintingFile = "$($SystemPrinting.FullName)\$($SystemPrintingFile)"
$ErrorActionPreference = "Stop"
Try
Add-Type -Path $SystemPrintingFile
$PrintServer = New-Object System.Printing.PrintServer("\\$($ComputerName)")
$PrintQueue = $PrintServer.GetPrintQueue($Name)
$PrintJobs = $PrintQueue.GetPrintJobInfoCollection()
Catch
Write-Error $Error[0].Exception
Break
Process
End
Return $PrintJobs
Refer to:
A print management library
If there is anything else regarding this issue, please feel free to post back.
If you have any feedback on our support, please click here.
Best Regards,
Anna Wang

Similar Messages

  • Problem With Business Object and printing job

    Hello,
    We are encountering a problem with the application "Business Objects FINANCE", and we would need your help quickly.
    In the application , itu2019s impossible to print Consolidated Subsidiaries nor the Securities Held. If we try so, the application freezes and we can't do anything but killing the application via the task manager.
    Though, other states can be printed without problem.
    We tried on several different PCs, and the problem occured equally on each one.
    The version installed is 10.5, and we can do any tests that you think would be useful to diagnose problem.
    Our society is AUBAY SA, and our credential to enter in your support website are : S0005386617
    In attachment youu2019ll find a screenshot of the event viewer from the server where the application is install.
    Thanks in advance for your answer,
    best regards.

    check the export parameters of the event triggering workflow.
    If there is a problem, try instantiating the object in your wf based on the key.
    Also check if the wf is able to import the data.
    regards,
    Sandeep Josyula

  • How to cancel print job with control panel on HP8610

    Is there a way to cancel a print using the control panel of the HP8610 rather than using task manager?
    This question was solved.
    View Solution.

    Welcome to the forums LucyRicky!
    I understand you are looking to cancel print jobs with your Officejet 8610. I have found 2 guides for you to show you how to cancel them.
    Windows: Cancel printing
    Mac: Archived - Mac OS X: How to Delete Printers and Print Job Lists in the Print Center
    I hope that helps resolve your question.
    Happy Thursday
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • Print job stuck

    When I print wirelessly from my laptop , prints fine but the paper is stuck and print job task bar shows status printing
    I have to cancel/delete the printjob through my laptop and then it spools out the paper.
    Print is fine though,,Any help?

    Hello @rayrock ,
    Welcome to the HP forum.
    I understand that you have a document stuck in the print queue.
    Try running the HP Print and Scan Doctor.
    Aardvark1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!

  • HP Laserjet utility starts and fails to go away after print job

    I have an HP Laserjet 1300 hooked to an Airport base station. After the Leopard install (a default, Upgrade install from 10.4.10), I had to re-ADD that printer in the Print & FAX Preferences panel -- it wasn't simply remembered. That went fine, and printing works as expected.
    EXCEPT: The HP Laserjet 1300 "utility" application (for managing the print queue) now activates with each print job -- not just when there is a problem such as "out of paper" as before. No problems are actually reported during or after the print job. And when the print job finishes, it doesn't go away. I have to manually Quit it.
    I can't find any option to have the "utility" activate only when it has some problem to report (i.e., the way it worked under Tiger), or to make it go away automatically when all print jobs are finished. Any suggestions?
    NOTE: When ADDing the printer in the Print & FAX utility, it did go looking for "new drivers", but didn't announce it found or installed anything new.

    Thank you. That's what I was looking for:
    Right click on the printer utility icon in the dock when you see it still sitting in there. Select "Auto Quit" from the pop up menu. Click on the utility to select it and open its queue window. Manually quit the utility.
    After those steps it appears the utility now activates in the dock and then goes away after each print job that finishes normally.
    Solved!

  • How to Capture print jobs and Data with WIN32 API?

    My organization has about 5 network printers and copiers to which a computer can print. What I'd like to do is build, if possible, a simple JAVA program to intercept what the users are printing (from any application) and capture certain information about the print jobs before it gets sent off to the specified printer.
    For example, when a user selects print from the menu in MS Word, and after the Ok button is pressed on the printers dialog window, have my program then pop up asking the user to fill in specific information (who they want to charge for the print job...this is typically an internal billing code, etc.).
    The program would have to capture the name/driver of the printer users are printing to, the document they printed, number of pages, number of copies, date/time, etc.
    Is/are there Windows API's to help in my programming of this application? I've been, unsuccessfully, searching MSDN, web sites, etc. on how to intercept/detect a print job. Any help would be greatly appreciated!
    Thanks ahead of time...

    Hi,
    Printing is nothing to do with database transaction. SP will not apply here. You may only try SDK.
    Thanks,
    Gordon

  • Initial Print jobs 'communication error with device'. Pause and restart job

    So, I have an odd variant of the Leopard print problem; on 3 separate systems.
    When I print to an HP Photosmart C7180, which setup fine, which I can scan to fine, the print job throws an error :error communicating with device, switch on and off' and so forth. It does that from any app, and consistently. I am printing via bonjour, the printer is networked, but on a static IP.
    To fix this EVERY-TIME I PAUSE printer, then start printer again. It immediately starts working, consistently until I sleep, log out, or don't print for a while.
    This seems to be some timeout issue or such. I tried IP printing, but no difference.
    Resetting the print system also did not help.
    It's not catastrophic but sooo annoying. Any input appreciated!
    Thx,
    Dan

    Hello SunnygirlQ. Welcome to the Apple Discussions!
    Unfortunately, not all USB printers are compatible with AirPort base stations. In addition, the AirPort's USB port does not support the "advanced" printer functions, like scanning, copying or faxing, of multi-function printers.
    To see if your printer is compatible, take a look at this iFelix Unofficial AirPort Printer Compatibility link.
    If your printer isn't listed, it doesn't necessarily mean it won't work, but simply that it has not been verified. iFelix also provides the following workaround for printers not on the list that would certainly be worth a try.
    Also you can try this Apple Tech Support article to see if it will help:
    o Printer troubleshooting for AirPort Extreme and AirPort Express
    I assume that this printer works just fine when it is connected directly to your Mac ... correct? If so, has it worked when connected to the AX in the past ... or has it always had this problem? If it did work correctly before, did you do any updates, especially to the AX, recently?

  • Printer Queue - How can I hide print job title and username?

    Hi,
    Does anyone know if it is possible to hide print job title and username in the printerqueue?
    Because of our privacy agreement we would like to hide this information, 
    Workstation OS: Windows 7 x64 
    Printserver : MS 2008 R2
    Thanks in advance
    Mark

    Not the user name but the job name is changed to Print Document when the print jobs are sent to Server 2012 and 2012R2.
    There is no Windows feature like this in 2008R2.  There are third party products that include job rename features for 2008R2
    Alan Morris formerly with Windows Printing Team

  • I can no longer print to the 3 Canon printers on my local area network. The print dialog box states that the print file is accepted and the job is printing, but the files never print. Everything worked when the computer and printers were initially set up.

    I can no longer print to the 3 Canon printers on my local area network. The print dialog box states that the print file is accepted and the job is printing, but the files never print. Everything worked when the computer and printers were initially set up.

    There may be some security issues related to the USPS PDFs.
    http://www.certified-mail-envelopes.com/signatures-usps-certified-mail-return-receipt-requested
    I can't help with the scan/print problem. You seem to have done everything I would try.
    I don't know if maybe using a registry cleaner would help.
    John Hoffman
    Conway, NH
    1D Mark IV, Rebel T5i, Pixma PRO-100, MX472

  • Print job gets to printer and vanishes or goes to the wrong tray

    I have one 10.4.11 computer in an office full of 10.4.11 computers and the print jobs either go to the printer and default to tray #1 which is always empty forcing the user to go to the printer and manually redirect the print job to the right tray otherwise the printer waits for input and creates a backup of print jobs for all the other users in the office or the print job goes to the printer and the data light blinks a few times and just vanishes and nothing happens. This happens when printing from the local admin account and the network user account. There are many users in the office and no one else is having this issue, it came up when the HDD was replaced and the system was rebuilt, I used the same image for another rebuild a month earlier and didn't get this issue. printers were added using printer setup utility and bonjuer as always tried adding with the ip address as well. The printers are two HP laserjet 9050's and a color laserjet 5550. I have tried changing every print tray setting I can find, this happens in every app that I have tried as well(cs2 indesign, illustrator, textedit, word) I have tried the reset printing system option in the printer setup utility and have re added the printers any number of times. The wall is still in one pice and my head is getting really sore please help.
    B

    Hi Brian, and a warm welcome to the forums!
    Not sure what it is, Might try Printer Setup Repair 5.1...
    http://www.fixamac.net/software/index.html

  • Colormunkie Photo printer profile (*.ICM and *.ICC ) are not seen by LR4.2 in the Print Job section

    Colormunkie Photo printer profile (*.ICM and *.ICC ) are not seen by LR4.2 in the Print Job section
    I used Colormunkie Photo to create an .ICM file for printer calibration.   When that failed I tried changing the suffix to .ICC.  Under neither circumstance did LR4.2 display the file in the menu to select printer profile.  There were several display files with both suffixes but no printer files at all.  I tried three times with no success and cannot think of what else to try. The first two were the same.  I varied the file creation name suffix in the third.  Help will be appreciated. My OS is Win 7 ultimate SP1  Printer is HP 2550L laserjet.

    Tillman
    Glad you found your answer, Colormunki is smart enough to figure out the color space for the printer as I found out - But for quality work the latest generation of inkjet printers from Epson and Canon are hard to beat, and compared to a laserjet the quality is like night and day. The other benefit of changing up to an inkjet printer is the choice of papers available which you could not put through a laserjet.
    I had a colleague that tried printing on Photoglossy paper through his color laser and it fried the fuser, and HP, while they replaced the fuser unit under warranty, made it very clear that that was a daft thing to do.
    So if I were in your position I would go with an inkjet and you will then enjoy the benefits of better quality output, better paper choices and with your Colormunki be able to make custom profiles that will work in LR
    Cheers
    Mike

  • I need to design and print enumerated event tickets.  What program on my Mac Book Pro should I use?

    I need to design and print sequential numbered event tickets.  What program on my Mac Book Pro should I use? i do not have  microsoft word nor do i want to download it , so just on the mac apps please ?

    This is for Pages '09, not possible in Pages 5 to my knowledge.
    See Numbered Tickets:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=182&mforum=iworktips ntrick
    Peter

  • View History of Print Jobs alongside w/ corresponding Form Name and Printer

    Hi guys,
    Just a small question. I have to do a particualr investigtion of a particular Job Order(Service). One of them includes checking the print history of its corresponding form name(sapscript), and printer device used for it.
    Is there a SAP table or TCode where this can be accessed?
    Thanks again and good day.

    Hi,
    SP01 transaction gives the details about printer and the spool. If you are able to recollect the scripts name by checking the spool output then this transaction will help you.
    In SP01 transaction, there are two tabs - Output request and spool request. Check both.
    The data of spool output and printer is stored in table from TSP01 till TSP09. But i dont think you would get the script or form name. You can only get the spool output from which you should determine the script/smartform used.
    Best regards,
    Prashant

  • MAC OS 10.9   some users cannot print to new Ricoh MP C6502   print job is holding for authentication and cannot figure out why

    I have a few IMAC and G5 users who have OS10.9 who cannot print to a new Richoh MP C6502, I downloaded and installed the new PS driver and it works on some systems but I have 3 people that goes right to Hold for Authentication.   I tried deleting everything associated with this in keychain access and after I did this it comes up to enter a password and it accepts the network login credentials but still holds the print job.  I even tried using guest as login and password as someone suggested but still cannot print any ideas on why?

    I apologize for the delay in responding to you.  I was on the road all day yesterday.
    OK.  I switched the printer's Ethernet cable to a Linksys Switch (Model EZX S55W) that's part of this local network.  That did not work.  I swapped out the cable for one that I know works.  Still no change.  I switched the printer's Ethernet cable directly to a port on the router.  No change.  I even swapped cables here, too, but no success.
    As I was doing all this, I was wondering: When I select the HP P1606dn printer in the Print and Fax "Add" dialog box, (see the image below) and the Print Using pulldown menu displays "Please select a driver or printer model" and the message "Searching for new drivers" appears under it (with the spinning wheel), why is it that the Ethernet connection to printer is critical to "finding" a new (printer) driver?
    Isn't the utility searching through my system and libraries looking for a printer driver app for the printer that I identified/selected in the dialog box?  
    After all, if the dialog box lists the printer among those to choose from, hasn't the utility already discovered the printer via the Ethernet connection?

  • JS: How to make a script to print one page at a time and set print job name?

    What I want is to print one page at a time to the printer.
    Document.print(false, app.printerPresets.item(0)) almost get me there. But how do I get it to print page by page? There seems to be no way to set which page to print to printerPreset.
    Also, is it possible to change print job name from the default of using document name?

    >Is there any solution to this other than saving the document to a different name before each page print?
    Here is an altered and abriged version of the script that I use. I use print preset called "PS to PDF" in it, so you should change it to your own.
    if(app.documents.length == 0){
       alert("Please open a document and try again.");
       exit();
    var myFolder = Folder ("~/Desktop");
    var myDoc = app.activeDocument;
    var myNoExtention = getFileNameOnly (myDoc.name);
    var myPrintPrefs = myDoc.printPreferences;
    if (app.printerPresets.item("PS to PDF") == null) {
       alert("Preset \"PS to PDF\" has not been installed");
       exit();
    else {
       myPrintPrefs.activePrinterPreset = app.printerPresets.item("PS to PDF"); 
    myDoc.sections.everyItem().sectionPrefix = "";
    myDoc.sections.everyItem().includeSectionPrefix = false;
       var stop = myDoc.pages.length;
       var w = new Window ( 'window', 'Printing PS-files' );
       var pb = w.add ('progressbar', [12, 12, 300, 24], 0, stop);
       var txt = w.add('statictext');
       txt.bounds = [0, 0, 200, 20];
       txt.alignment = "left";
       w.show()
    for(var myCounter = 0; myCounter < myDoc.pages.length; myCounter++){
       curPage = myCounter + 1;
       pb.value = curPage;
       var myText = String("Page " + curPage + " of " + myDoc.pages.length);
       txt.text = myText;       
       var myPageName = myDoc.pages.item(myCounter).name;
       var cornumber = pagenum(myPageName);
       var myFilePath = myFolder + "/" + myNoExtention + "_" + cornumber + ".ps";
       var myFile = new File(myFilePath);
       myPrintPrefs.pageRange = myPageName;
       myPrintPrefs.printFile = myFile;
       myDoc.print(false);
    w.hide();
    alert("Done!");
    function pagenum(myNumber){
       if (myNumber >= 1 && myNumber <= 9)
       x =  "0" + "0" + myNumber;
       else if (myNumber >= 10 && myNumber <= 99)
       x = "0" + myNumber;
       else if (myNumber >= 100 && myNumber <= 999)
       x = myNumber;
    return x
    function getFileNameOnly (myFileName) {
       var myString = "";
       var myResult = myFileName.lastIndexOf(".");
       if (myResult == -1) {
          myString = myFileName;
       else {
          myString = myFileName.substr(0, myResult);
       return myString;
    Kasyan

Maybe you are looking for

  • Importing to I-Movie - lost sound AND video

    Hi. I have a feeling this has already been answered but here goes: I recorded some video on my Sony still camera in MPEG format (.mpg files). They worked fine in I-photo. When I imported them into Imovie though, I not only lost sound but it would see

  • How do i change the wrong apple id in my app store on my phone

    My phone wasn't working right, so I took it to the sprint store to get a new one using my insurance and they gave me a new one. the only weird thing is that when I go to update my apps it asks me to long on to someone else's email. I have gone into m

  • The speaker in my notes has greyed out all of a sudden.  How do I get it back?

    I use my notes a lot and use the speaker to input them.  All of a sudden the speaker button greyed out and I can't get it to work.  Any idea how I can fix this?

  • BDC for Transaction F-02

    Hi, Any idea how to write BDC for transaction F-02? The problem is how do we upload one item after another within the same loop? Regards, Naba

  • Select Options in Web dynpro

    Hi, I have a report, this has select options for users to enter the selection criteria. On the screen users can see 'Cancel', 'Check', 'Reset' and 'Copy' buttons but NO 'SAVE'!!! Is there a way to save the selection made by the user as a variant? by