Solved

Printer Notifications

Posted on 2003-11-14
8
457 Views
Last Modified: 2010-04-13
Ok, I've got some whining users that I just completed surgery on. Yep, removed large growths called netware protruding from their psychies and eating at their productivity. And now calmness and serenity becomes me......

They miss their printer pop-up notifications that used to inform them of oddities such as empty paper bins and low towner situations.

I guess you don't know what you've got til it's gone. and I'm almost sure nobody has realized that their print jobs are consistently PRINTING now. Maybe that's why the paper and toners are low all the time.... LOL!

Sooooooooo..... I was wondering if anyone had ever implemented broadcast messages from the print server in any form to notify of these situations. I've looked all over and found nothing on the subject. HoHum.
0
Comment
Question by:PaulHieb
  • 4
  • 3
8 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 9752155
I don't know but I think you need to do more surgery, maybe on the brain, on these folks and wean them from there ways. LOL
0
 
LVL 2

Author Comment

by:PaulHieb
ID: 9752193
These words you speak are wise and foolish all at the same time. :)
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 9752290
Yeah I know but brain surgery on uses does wonders for the admins :)
0
 
LVL 2

Author Comment

by:PaulHieb
ID: 9752763
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 2

Author Comment

by:PaulHieb
ID: 9755265
I found the VB to write out a little applet:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService. _
    ExecNotificationQuery("SELECT * FROM __instancemodificationevent " _
        & "WITHIN 30 WHERE TargetInstance ISA 'Win32_Printer'")
i = 0
Do While i = 0
    Set objPrinter = colPrinters.NextEvent
    If objPrinter.TargetInstance.PrinterStatus <> _
        objPrinter.PreviousInstance.PrinterStatus Then
        Select Case objPrinter.TargetInstance.PrinterStatus
            Case 1 strCurrentState = "Other"
            Case 2 strCurrentState = "Unknown"
            Case 3 strCurrentState = "Idle"
            Case 4 strCurrentState = "Printing"
            Case 5 strCurrentState = "Warming Up"
        End Select
        Select Case objPrinter.PreviousInstance.PrinterStatus
            Case 1 strPreviousState = "Other"
            Case 2 strPreviousState = "Unknown"
            Case 3 strPreviousState = "Idle"
            Case 4 strPreviousState = "Printing"
            Case 5 strPreviousState = "Warming Up"
        End Select
        Wscript.Echo objPrinter.TargetInstance.Name _
            &  " is " & strCurrentState _
                & ". The printer previously was " & strPreviousState & "."
    End If
Loop

--------

Even ported it to asp with some minor changes:

--------

<%
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters =  objWMIService.ExecQuery ("SELECT * FROM Win32_Printer")
For Each objPrinter in colInstalledPrinters
    Response.Write("Name: " & objPrinter.Name & "<br>")
    Response.Write("Location: " & objPrinter.Location & "<br>")
    Select Case objPrinter.PrinterStatus
        Case 1
            strPrinterStatus = "Other"
        Case 2
            strPrinterStatus = "Unknown"
        Case 3
            strPrinterStatus = "Idle"
        Case 4
            strPrinterStatus = "Printing"
        Case 5
            strPrinterStatus = "Warmup"
    End Select
    Response.Write("Printer Status: " & strPrinterStatus & "<br>")
    Response.Write("Share Name: " & objPrinter.ShareName & "<br>")
    Response.Write("<hr>")
Next
%>
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 9757218
Where did you find the script?
0
 
LVL 2

Author Comment

by:PaulHieb
ID: 9757344
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/scrguide/sas_prn_yope.asp

Lot's of cool ones on there, I even wrote one to add/remove printers out several different script samples, Here's what I ended up with in a .vbs, then just assigned each user's "Office" Field a value from AD users and computers of either Main or sales. Here's the VBscript:

On Error Resume Next

Set objNetwork = CreateObject("Wscript.Network")

strUserName = objNetwork.UserName

Set objUser = GetObject ("LDAP://cn=" & strUserName & ",ou=Users,dc=domain,dc=com")

' This is the Office Field of the Users account properties
If objUser("physicalDeliveryOfficeName") = "Sales" Then
      objNetwork.RemovePrinterConnection "\\srv1\Savin993"
      objNetwork.RemovePrinterConnection "\\srv2\MTSLJ4"
      objNetwork.RemovePrinterConnection "\\srv2\MTSLJ5"
      objNetwork.AddWindowsPrinterConnection "\\srv1\sharedfax"
      objNetwork.AddWindowsPrinterConnection "\\srv2\tektronix"
      objNetwork.AddWindowsPrinterConnection "\\srv2\LJ5Sales"
      objNetwork.AddWindowsPrinterConnection "\\srv2\lj4050pro"
      objNetwork.SetDefaultPrinter("\\srv2\LJ5Sales")

ElseIf objUser("physicalDeliveryOfficeName") = "Main" Then
      objNetwork.RemovePrinterConnection "\\srv2\MTSLJ4"
      objNetwork.RemovePrinterConnection "\\srv2\LJ5Sales"
      objNetwork.RemovePrinterConnection "\\srv2\lj4050pro"
      objNetwork.AddWindowsPrinterConnection "\\srv1\sharedfax"
      objNetwork.AddWindowsPrinterConnection "\\srv2\tektronix"
      objNetwork.AddWindowsPrinterConnection "\\srv2\MTSLJ5"
      objNetwork.AddWindowsPrinterConnection "\\srv1\Savin993"
      objNetwork.SetDefaultPrinter("\\srv2\MTSLJ5")

Else
   Wscript.Echo "User " & objNetwork.UserName & "not an office User. No Printers Mapped/Removed."
End If
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 9918457
User resolved; points refunded and question closed.

Netminder
EE Admin
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now