Jump to content

Recommended Posts

Posted

Good morning!

 

Odd question - I have printers listed in our 2008 print server. Certain staff get emails on low toner, etc. Part of the info they need to replace the toners is listed in the comment field for each printer. Example attached

printerComment.JPG

 

I need to include in low toner email the ESI#, in this case, ESI#96556. I see no way to do this in the printer notifications section as set up my Microsoft. Does anyone know of a scripting solution I can use? Any tricks to include some sort of variable in the email message?

 

The obvious workaround is for me to include the ESI# in the printer name, but this will require me to rename and push out ~250+ printers. I can do it, but would prefer another way if it's at all possible.

 

Thanks!

 

Damian

Posted
So each printers comment field is always updated with this ESI number and you want a hta or something to enumerate all printers , you select a printer from the drop down menu and in a text field or label it shows you the comment ( and at the same time ) copies this to your clipboard so you can paste it into an email or what exactly ?
Posted

Not exactly. In Printer Management, I can set up a Custom Filter and have it email staff on certain status - in this case, Toner Low. See photo:

sendEmail.JPG

Is there anything else I can do in the Message field to get the comment section sent along with the notification of the low toner.

 

Alternatively, is there some way to pull this Comment text out via a batch or VB script? I can email it off the command line if I need to.

Posted (edited)

vbscript and wmi - is this running from the print server itself ?

 

Win32_Printer class

 

Using win32_Printer you have the option for comment, there is a vbscript example near or at the bottom of said page however this is in relation to getting the default printer name and not the comment related to the said printer but it is easy enough to edit.

 

[color=#000000][font=Consolas]strComputer = "."[/font][/color]
Set objWMIService = GetObject( _    "winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters =  objWMIService.ExecQuery("Select * from Win32_Printer Where Name='Printer_Name'")
For Each objPrinter in colInstalledPrinters          
Wscript.Echo "Comment: " & objPrinter.Comment    
[color=#000000][font=Consolas]Next
[/font][/color]

 

The above code snippet would run on the computer you executed the vbscript file on.

Edited by mac_shinobi

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...