How do I programatically get realtime printer status

Al Harper 1 Reputation point
2021-04-14T18:12:47.34+00:00

I need a way to programmatically retrieve accurate physical print status ( ONLINE, OFFLINE, POWERED OFF ) at any time.
Using the spooler API calls like GetPrinter() along with the various PRINTER_INFO_x structures do not work.
The status in these calls and the like are only valid if print jobs have been submitted, and if there is an error reported while printing or after the job is complete.
I need to get the real time status whether a job is submitted or not. During printer idle time.

Does anyone have an answer?

Al

Windows for business | Windows Server | User experience | Print jobs
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Al Harper 1 Reputation point
    2021-04-20T02:19:28.203+00:00

    Even though we do cloud I'm not at all interested in any cloud solution. In part or in whole.

    This is an existing install base that would not tolerate trying to drag cloud into the mix. So let not drag Azure or cloud into this at all.

    You keep gravitating back to "print jobs". While a print job is certain very important as well as the success or lack of it, that still does not come close to answer/solving my problem. Once again, I need accurate "REAL-TIME" printer status regardless of whether a print job is in process or not.

    So ... one last time, with NO JOB I want to know what a given printers physical status is. If the printer is so equipped with an OFFLINE button and I press the button to take the printer OFFLINE I want the printer status to reflect OFFLINE. Same thing with the other 2 transitions, ONLINE, and POWER_OFF.

    Thanks Al Harper


  2. Anonymous
    2021-04-20T01:31:45.973+00:00

    Hi@Al Harper

    How about the Universal Print runs on Microsoft Azure, a modern print solution that organizations can use to manage their print infrastructure through cloud services from Microsoft.

    Using Universal Print, an admin can view the status of each print job in your organization. When users print a document, the print job is sent to the Universal Print service. After the print job is received, the target print device is notified by the service that the job is available to process. The service tracks the job status on the print device and sends updates to the client, where they are displayed to the user. As an administrator, you can view the print job status of each print job through the administrator portal.

    Best Regards
    Karlie

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Al Harper 1 Reputation point
    2021-04-19T23:58:12.89+00:00

    I understand that from certain application perspectives this may be acceptable. However in a commercial environment this is not acceptable at all.
    I work for a major corporation wherein we have a huge install base of large customers running their application(s) which run on our platform and they demand real time accurate physical device status ( ONLINE, OFFLINE, POWERED_OFF ) at a minimum.

    Is there no solution Microsoft can provide to accomplish this?

    This solution MUST work on both physically attached printers as well as network attached printer.

    Any help would be much appreciated.

    Al Harper

    0 comments No comments

  4. Anonymous
    2021-04-15T02:46:59.06+00:00

    Hello @Al Harper

    "There is one fundamental premise that must be true to determine the state of a physical printer: the Spooler must be attempting to send a print job to the physical printer. This is the only time the state of the printer is reported by the port monitor. In addition, the most meaningful information may be reported in the status members of a JOB_INFO structure for that particular print job because some port monitor will have set these values directly."

    Get the status of a printer and a print job

    Best Regards
    Karlie

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.