Solved

Printer Notifications

Posted on 2003-11-14
8
462 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
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: 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtualise server 2000 for Hyper V 4 849
Application Deployment 2 257
Migrate Windows NT to Windows 2003 2 512
Windows 2000 undelete (free program?) 6 430
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…
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 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