Announcement

Collapse
No announcement yet.

Total Pages Printed from Printer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Total Pages Printed from Printer

    Does anyone know how to find the total amount of pages a printer has printed? Not the total amount of pages printed for a job, but the whole printer itself. I know there is a script for a jobs, but I do not see any for the whole printer.

  • #2
    Re: Total Pages Printed from Printer

    All my HP printers have internal counters. This is how I know how many pages were printed between two toner changes. You should check on the printer itself.
    What model are we talking about?

    Sorin Solomon


    In order to succeed, your desire for success should be greater than your fear of failure.
    -

    Comment


    • #3
      Re: Total Pages Printed from Printer

      I know you can get it from the printer itself, but I'm trying to do them all at once on the printer server and print out a report. We have several different models.

      Comment


      • #4
        Re: Total Pages Printed from Printer

        There's this script:

        Code:
        strComputer = "."
        Set fso = CreateObject("Scripting.FileSystemObject")
        Set tf = fso.CreateTextFile("c:\Total_Print_Queue.txt", True)
        i = 1
        Set objWMIService = GetObject("winmgmts:" _
            & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
        
        Set colPrintJobs =  objWMIService.ExecQuery _
            ("Select * from Win32_PrintJob")
        
        For Each objPrintJob in colPrintJobs 
            intTotalJobs = intTotalJobs + 1
            intTotalPages = intTotalPages + objPrintJob.TotalPages
            If objPrintJob.TotalPages > intMaxPrintJob Then
                intMaxPrintJob = objPrintJob.TotalPages
                tf.writeline "Total print jobs in queue: " & intTotalJobs 
                tf.writeline "Total pages in queue: " & intTotalPages
                tf.writeline "Largest print job in queue: " & intMaxPrintJob
                 i = i + 1
           Else
           End if
        Next
        But it is for the current print jobs...

        Comment


        • #5
          Re: Total Pages Printed from Printer

          Oh.... Sorry...
          You didn't say anything about a print server I jumped too fast...
          I know that for any job printed, there's an event written in the Event Viewer -> System, with Source=Print and EventID=10 (for printed jobs) or 12 (for held jobs).
          Does it help anyhow?
          Last edited by sorinso; 28th February 2007, 20:16.

          Sorin Solomon


          In order to succeed, your desire for success should be greater than your fear of failure.
          -

          Comment


          • #6
            Re: Total Pages Printed from Printer

            Hmm I just need to find out how to get the total number of pages printed by the printer.

            Comment


            • #7
              Re: Total Pages Printed from Printer

              Then you need a printer which makes this data available via its external interface to the PC in a recognised way. Generally, if you can get the info in the printer's "About" box in the driver control panel, then you will be able to extract it using WMI. I would think. If the printer doesn't make this data available except on its internal firmware for printer engineers to view, then you're stuffed.


              Tom
              For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

              Anything you say will be misquoted and used against you

              Comment


              • #8
                Re: Total Pages Printed from Printer

                Originally posted by ekrengel View Post
                Hmm I just need to find out how to get the total number of pages printed by the printer.
                But why not look at scripting the answer? It could poll through all the event 10's and report on how many pages a printer has printed. The event has all the required information.
                Server 2000 MCP
                Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

                ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                Comment


                • #9
                  Re: Total Pages Printed from Printer

                  How do you do [email protected]!

                  Comment


                  • #10
                    Re: Total Pages Printed from Printer

                    Originally posted by ekrengel View Post
                    How do you do [email protected]!
                    Well it would first get the correct events:

                    Code:
                    strComputer = "."
                    Set objWMIService = GetObject("winmgmts:" _
                        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
                    
                    Set colLoggedEvents = objWMIService.ExecQuery _
                            ("Select * from Win32_NTLogEvent Where Logfile = 'Application' and " _
                                & "EventCode = '10'")
                    
                    strEventString = colLoggedEvents.Message
                    Then look inside the string for the correct printer and how manay pages. Put it in a loop to get it totalling up. You may need to change the date range it looks at.

                    I've given you a start - have a go at finishing it.
                    Server 2000 MCP
                    Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

                    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                    Comment


                    • #11
                      Re: Total Pages Printed from Printer

                      Hmm, except its not going to be just one printer, more like 50 that are different models.

                      Comment


                      • #12
                        Re: Total Pages Printed from Printer

                        Originally posted by ekrengel View Post
                        Hmm, except its not going to be just one printer, more like 50 that are different models.
                        Come on! You're not even trying! That should be straight forward. For someone that has started 13 threads in the scripting forum, i would have thought it was obvious to you that you need to start to learn how to do this sort of thing, instead of relying on free script creation by this forums regular users.
                        Server 2000 MCP
                        Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

                        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                        Comment


                        • #13
                          Re: Total Pages Printed from Printer

                          Haha alright let me work on this.

                          Comment


                          • #14
                            Re: Total Pages Printed from Printer

                            Originally posted by ekrengel View Post
                            Haha alright let me work on this.
                            Good on ya - feel free to post when you get stuck. We can always point you in the right direction
                            Server 2000 MCP
                            Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

                            ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                            Comment


                            • #15
                              Re: Total Pages Printed from Printer

                              I have no idea if im on the right track here...its probably completely wrong.

                              Code:
                              strComputer = "."
                              Set fso = CreateObject("Scripting.FileSystemObject")
                              Set tf = fso.CreateTextFile("c:\TotalPages_Per_Printer.txt", True)
                              Set objWMIService = GetObject("winmgmts:" _
                                  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
                              Set col = objWMIService.ExecQuery("SELECT * FROM Win32_Printer")
                              Set colLoggedEvents = objWMIService.ExecQuery _
                                      ("Select * from Win32_NTLogEvent Where Logfile = 'System' and " _
                                          & "EventCode = '10'")
                              i = 1
                              
                              For Each item In col
                              tf.writeline "Printer: " & item.DeviceID
                              tf.writeline "Location: " & item.Location & vbcrlf
                              tf.writeline "===================================="
                              For Each objLoggedEvents in colLoggedEvents
                                       strEventString = colLoggedEvents.Message	
                              	If strEventString = "item.DeviceID" Then
                              
                              tf.writeline "Total Pages Printed:" 
                              
                              i = i +1
                              else
                              end if
                              next
                              next
                              tf.close

                              Comment

                              Working...
                              X