LabTech Plugin – Printer Health Status

On May 21, 2014, in How-to, Scripting, by Cubert aka (Cube Dweller)


     Printer Health Status



Mr Keigher posted on the Labtech forums that wouldn’t it be great if there was a Printer Status Plugin for Labtech that could show if there were any issues with a printer and maybe even interact with a failed printer. Well Marty your ship has come in! Let me introduce you to your new Printer Status Plugin. The team down in Squidwork’s basement went to town taking what seemed like minutes (and it looks like it) to build a Labtech plugin that would do what had to be done.


In Version 1.0.4 you have good management over printers in 2 main views; the global view and the client view. The Global view allows for the full management suite of tools to be executed on any printer being scanned and will give you a quick view in to the troubles your clients maybe having. The Client view provides the same management functions but also allows you to enable and disable scanning for a client and to include desktops in printer scans.


Lets show you what we have:


Printer Status Global Manager:


Printer Status at the Client Console:


Printer Status Exclude Printers:




Download Labtech Plugin – Printer Status Version 1.0.4




25 Responses to “LabTech Plugin – Printer Health Status”

  1. Hey Cubert,

    Thanks a ton for this… you are a star! 🙂

    I’ll get it installed today (been out of town for a bit), and will give you some feedback pretty soon!

    Have a great weekend and THANK YOU for everything you do for our awesome LT Community! 🙂

  2. Jason Mance says:


    I installed your Plug-in today and the printer data is not being populated as of yet. Does it take a few hours to populate or is there something else that I need to do as well? New to the LT Customizing Community. Thanks.

  3. Jason Mance says:

    Nevermind, I was able to get it running. Thanks. Great tool!!!

  4. Steve says:

    The printers tab shows up but there is nothing there. You mention a second script but there was only one and a DLL file in the archive. Am I missing something?
    Thanks in advance!

  5. Michael says:

    Trying various plugins here – great stuff! You’re amazing! 😛
    Anyway, most things seem to be working okay, but a couple, like this one, give the error “Object reference not set to an instance of an object.” which is one of the more annoyingly generic error messages around. Fortunately, this plugin happens to provide a few more details, so I’m posting them here in hopes that somebody knows the answer:
    System.NullReferenceException: Object reference not set to an instance of an object.
    at PrinterStatus.PrinterStatus_Host_uc.loadPrinters()
    at PrinterStatus.PrinterStatus_Host_uc.PronterStatus_uc_VisibleChanged(Object sender, EventArgs e)
    at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
    at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
    at System.Windows.Forms.Control.OnParentVisibleChanged(EventArgs e)
    at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
    at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
    at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
    at System.Windows.Forms.TabPage.set_Visible(Boolean value)
    at System.Windows.Forms.TabControl.UpdateTabSelection(Boolean updateFocus)
    at System.Windows.Forms.TabControl.OnSelectedIndexChanged(EventArgs e)
    at System.Windows.Forms.TabControl.WmSelChange()
    at System.Windows.Forms.TabControl.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    …followed by a long list of loaded assemblies which seem to be in good order…

    This is a new LT install on an AWS instance of 2008 R2. It’s patched and updated Windows-wise and the LT updates have been applied, but not much else has been done to it. The rest of LT seems to be working fine. I’m assuming there’s just a .Net library or something missing but without a working system to compare to it’s a bit difficult to ascertain what it might be.
    Anybody already solve this problem and can point me in the right direction? – Thanks! :):)

  6. Michael says:

    Based on other plugin issues people have reported I decided it’s probably a missing SQL table, et voila’ – there are no plugin_sw_* tables at all! (This might be the cause of the couple other plugins not working as well.) Haven’t yet found the root cause of that and, sadly, what was suggested as a (generally successful) fix for others – to remove and reinstall the plugin(s) – hasn’t worked for me. :/ But at least I’m *one* step closer! 😛

  7. Michael says:

    To clarify, I did the following for the plugin reinstall process:
    – open the plugin manager
    – deselect the plugin
    – click refresh to get the removal button active
    – removed it
    – restarted the console
    – installed the plugin and selected it
    – restarted the console
    – didn’t see the plugin tabs anywhere and found that the selection didn’t “stick”
    – reselected it in the plugin manager
    – restarted the console
    – plugin tabs are back (yay!)
    – SQL tables are still missing (boo)
    – deleted and re-imported the script
    – tables are still missing
    – restarted the console
    – tables are still missing
    – ran the script on a PC
    – tables are still missing… :/

  8. cubert says:

    here is the sql query to create the table needed for this to operate.

    CREATE TABLE `plugin_sw_printerstatus` ( `ClientID` INT NOT NULL , `LocationID` INT NOT NULL , `ComputerID` INT NOT NULL , `Printer` VARCHAR(245) NOT NULL , `Status` VARCHAR(45) NOT NULL DEFAULT ‘OK’ , PRIMARY KEY (`Printer`, `ComputerID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8

    Copy and run against the LT server to create new table.


  9. Michael says:

    Ve-e-ery interesting!
    Thanks for that, but read on for more exciting details!
    I ran the snippet above (forum quotes fixed of course) and got an error that the table already existed, wtf? And lo and behold, not only does it exist but now so do all the others that were missing! (And the other plugins work now as well of course, yay!)
    As a note for anyone else that runs into this, I found them all missing at least several *hours* after the plugins were installed. My best guess is that the LT server must have queued things up to run after some nightly scheduled maintenance. Or something. (Why?!? Simply creating new tables shouldn’t affect anything else. Bizarre.)
    Anyway, the TL;DR; here is if you’re messing with plugins and they’re missing tables, try waiting a day… 🙂

  10. Yes, a restart of the LT database agent may also resolve issues like you were seeing where system just failed to create DB tables.

  11. George says:

    Any plans on adding it at the location level? Also, Is their a way to display the friendly name instead of the computer name of these plugins?

  12. Bas says:

    Hi Cubert,

    Really like what youre developing for LabTech. May I add a feature request? Exclude redirected printers or make an option to choose if they may be excluded.

    And how do I delete a printer like a redirected one from the DB? The rows I select are unavailable for deletion.

  13. Eric says:

    I am having a similar issue as above. There was only one dll to load and I loaded it. The Printer Status tab appears but there is no data. Does it take time to populate?

  14. Eric, The zip should of come with a XML to import using the importer under the tools menu in LT console.

    Once this is done you will need to schedule the new script to a group. I normally tie it to my 24/7 windows groups to run every few hours. When the script runs against the group you assigned it to then those systems will have printers showing up with in their tabs.

    so search scripts for “Get Printer Status” to find where the script is and schedule it against your windows groups.

  15. Eric says:

    Thanks a lot!
    Next question, what is it querying? Just the spooled jobs?
    Is there any way to setup alerting on the failed statuses?

  16. we just released version 1.0.4 with many improvements, so much so you will need to come and check it out.

    Very cool stuff and much better control with ease of use.

  17. Ryan says:


    Thanks for making great plugins! When I download this I am only seeing a dll file but no XML. Is this correct?

  18. That is correct, The new plugin auto creates the scripts now.

  19. WHairstonLOI says:

    Totally new to LabTech – just downloaded and installed v1.04. The tab appears under the client, but it is empty. I enabled scans (first option), but how do I control how often the scans occur?

    I tried searching for the “Get Printer Status” mentioned in comments above, but cannot find it. Is there a new way of scheduling scans in v1.04?

  20. Hugh says:

    @WHairstonLOI – it’s called PrinterStatus Maintenance for me

  21. Chris says:

    Any issues running this in 10.5?

  22. Heinz says:

    the script isn’t created automatic. i have a Gemran labtech Version.
    Can you publish the PrinterStatus script code?
    Thank you

  23. Heinz says:

    Hello again,
    over night the script now exists. Verry Good.
    Best Regards

  24. LePage says:

    This script is not running on our cloud server.
    Database exists from the text provided above.
    Your thoughts?

  25. Martyn says:

    Hey buddy,

    Just tried to load this on a LT10.5 system, but getting an error on load. Is it 10.5 ready yet??


Leave a Reply


%d bloggers like this: