Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Printer Notifications

Posted on 2003-11-14
8
Medium Priority
?
479 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
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
LVL 2

Author Comment

by:PaulHieb
ID: 9752763
0
 
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

772 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