Solved

Printer Notifications

Posted on 2003-11-14
8
459 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

13 Experts available now in Live!

Get 1:1 Help Now