Solved

Printer Notifications

Posted on 2003-11-14
8
465 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
HP ML 110: This System is not supported platform 1 518
Remote Access to a Windows 2000 Computer 2 508
Application Deployment - Simple 7 652
win2k service packs 5 657
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…
Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 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