none
Printers Toner level status script

    Question

  • Hi All,

    I am looking for a powershell script to  checks for the all printers in the network and send an email about the printers less than 10%.

    Thanks

    Thursday, April 05, 2012 3:29 PM

Answers

All replies

  • Did you look in the repository under 'printers'?


    ¯\_(ツ)_/¯

    Thursday, April 05, 2012 3:42 PM
  • I'll bet you 5 points it can't be done.  I say that without even looking.

    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

    Thursday, April 05, 2012 3:45 PM
  • Yes i did, but all of them checks the printers queue status in the "Print Management" and it sometimes it remains in "Ready" state even if toner status is less than 10%, that's why i am looking for something different.

    Thanks

    Thursday, April 05, 2012 3:48 PM
  • Yes i did, but all of them checks the printers queue status in the "Print Management" and it sometimes it remains in "Ready" state even if toner status is less than 10%, that's why i am looking for something different.

    Thanks

    Many older printers do not update the status until you print something so you wil not be able to get it.  If it isn't in PrintManager then you will need to query the printers directly using either the API or a remote web call if the printer has a web page.  This is vendor specific and ther is really no way for any of us to know how to build a script for you printers.

    Start by asking the vendor if they have a ustiity that runs at the commandline.

    Some printers can be queried with DEVCON which can be downloaded from MS.

    Windows PRNMNGR -l can list all of the status of all printers but almost all printers that are not enterprise printers will show 'unknown'  HP Enterprise printers will show a status usually.


    ¯\_(ツ)_/¯

    Thursday, April 05, 2012 4:00 PM
  • Hi there,

    you can try though WMI Classes. If you have a Printer Server you just need to make a WMI Query in your server. You will be able to see if printers are in the state "Toner Low". (Not sure when this status triggers)

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa394363(v=vs.85).aspx

    PrinterState property

    Some properties may work, some not. It depends in manufacturer.

    Best Regards

    Saturday, April 07, 2012 3:45 PM
  • Check the DetectedErrorState property of the Win32_Printer class documented in the link Eversong posted. 5 means "low toner" and 6 means "no toner". The PrinterState property is deprecated. If this doesn't work, either the printer doesn't support it, or perhaps you need to send a document to the printer to trigger the condition.


    Richard Mueller - MVP Directory Services

    Saturday, April 07, 2012 5:16 PM
    Moderator
  • Yes i did. It depends upon the quality of printer.Some printer do not update the query. It also depends on the manufacturing of printers.
    Tuesday, June 12, 2012 11:09 AM
  • You can use Telnet. I have done it quite a bit and still do. I have yet to find a mid-range network printer that doesnt support it. SNMPGET is useful, but telnet is the icing on the cake. Win7 still has it, but you have to enable it. Once connected to the printer, use PJL or Printer Job Language to communicate. For example, http://www.irongeek.com/i.php?page=security/networkprinterhacking  @PJL RDYMSG DISPLAY="Some Text"  This website explains it just as well as I can. Write a batch file or use powershell. Dispite the age of this protocal, it is so very handy in a domain environment.

    This is the most direct way because you are in direct contact with the printer. You can get exact counts and levels, not just 'low' which is easy to get through WMI.

    • Proposed as answer by Alextricity Wednesday, March 06, 2013 2:43 AM
    • Edited by Alextricity Wednesday, March 06, 2013 3:07 AM
    Wednesday, March 06, 2013 2:43 AM
  • You can use Telnet. I have done it quite a bit and still do. I have yet to find a mid-range network printer that doesnt support it. SNMPGET is useful, but telnet is the icing on the cake. Win7 still has it, but you have to enable it. Once connected to the printer, use PJL or Printer Job Language to communicate. For example, http://www.irongeek.com/i.php?page=security/networkprinterhacking  @PJL RDYMSG DISPLAY="Some Text"  This website explains it just as well as I can. Write a batch file or use powershell. Dispite the age of this protocal, it is so very handy in a domain environment.

    This is the most direct way because you are in direct contact with the printer. You can get exact counts and levels, not just 'low' which is easy to get through WMI.

    Dear, I am looking to create a VBA script to perform the task of capturing the toner printer status graphically or as a percentage. Recalling that the printers are networked. It is possible?

    ------------------------------------------------------------------------

    Referring to my question on the forum, you said three solutions.

    But how would the implementation of these two solutions:

    2. If the printer has a web interface and it shows toner levels, You could query the web page using IE automation or XMLHttpRequest. This is probably the easiest option.

    3. Run Telnet command (s) from VBA and capture and parse the output, if toner level data is provided.

    I am new in this area of process automation via VBA script, you help me?

    _Follow the link in my spreadsheet development: _*http://1drv.ms/1LPvnom
    *

    *Below is a possible solution to my problem also could not implement in my spreadsheet.*

    *Then also enter the source code of web access printer page.

    *

    -------------------------------------------------------------------

    Substatus_impressora()
    '
    'status_impressora Macro
    'Retorna o status do tonner da impressora na rede
    '
    'Atalho do teclado: Ctrl+s
    '
    WithActiveSheet.QueryTables.Add(Connection:= _
    "URL;http://*200.200.200.200* (http://<strong>200.200.200.200</strong>)",Destination:=Range*( _"$F$4"))* 
    .Name= *nível_toner*
    .FieldNames= True
    .RowNumbers= False
    .FillAdjacentFormulas= False
    .PreserveFormatting= True
    .RefreshOnFileOpen= False
    .BackgroundQuery= True
    .RefreshStyle= xlInsertDeleteCells
    .SavePassword= False
    .SaveData= True
    .AdjustColumnWidth= True
    .RefreshPeriod= 30
    .WebSelectionType= xlSpecifiedTables
    .WebFormatting= xlWebFormattingNone
    .WebTables= """ctl12_dtgMateriaisSerial""" *'**The ID TABLE WHERE IS THE STATUS OF TONNER LOOK NO HTML*
    .WebPreFormattedTextToColumns= True
    .WebConsecutiveDelimitersAsOne= True
    .WebSingleBlockTextImport= False
    .WebDisableDateRecognition= False
    .WebDisableRedirections= False
    .RefreshBackgroundQuery:=False
    EndWith
    EndSub
    -------------------------------------------------------------------------------------------------------------------------------


    Good afternoon,


    I am with this worksheet, I could not implement this script in my spreadsheet.


    For me to analyze the toner level of the 20 printers that I am responsible, it will be necessary to create a user form and a button?


    Or which feature exactly I could use.


    As the attached spreadsheet data is shown by the Range F4 to F24.


    And script_commands file is the printer HTML command line.


    Since already thank their support.

    ------------------------------------------------------------

    _Follow the link in my spreadsheet development: _*http://1drv.ms/1LPvnom*
    ---End Quote---


    Thursday, September 10, 2015 3:23 PM