Solved

Gathering Data from Printers on network

Posted on 2006-06-26
9
226 Views
Last Modified: 2010-04-23
I have some code that will browse through my network, pulling all computer names currently on my network.
I pass the computer name(s) to the following function, returning all installed printers containing the word "Laser" on XXXX machine.
(ie i only care about the hp laserjets on the network at this time)

Private Function GetPrinterList2(ByVal server As String) As String
        Dim locator As Object
        Dim instances As Object
        Dim iPrinter As Object
        Dim text As String = ""


        locator = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & server & "\root\cimv2")
        instances = locator.ExecQuery("Select * from Win32_Printer")

        For Each iPrinter In instances
            If Not IsNothing(iPrinter) Then
                If InStr(iPrinter.Name, "Laser") > 0 Then
                    text = text & "User: " & server & " -- "
                    text = text & "Name: " & iPrinter.Name & ", "
                    text = text & "ShareName: " & iPrinter.ShareName & ", "
                    text = text & "Location: " & iPrinter.Location & ", "
                End If
            End If
        Next

        GetPrinterList2 = text

    End Function


What I want to do after, or during, this function is grab a config report off of said Laserjet. The config sheet is one that you can pull manually by going around to each machine. It gives total pages printed (which is what I'm after). That way I can run this program in set intervals of maybe 1-2 weeks and have a good idea of what the people on my network are printing, quantity wise. I'm not even sure this is entirely possible without installing software on the client's machine, but I'd rather not install any software on their machines.

Thanks,
Corey
0
Comment
Question by:cwile
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 6

Expert Comment

by:manicsquirrel
ID: 16988761
Most laserjets with a built-in print server (network connection) have an internal web interface.  From this interface you can view the information you're looking for.  A solution for you might be to open an HTTP session with each print server, download its HTML and parse it for the info you desire.

Without doing some investigating, I don't know how you would enumerate the IP addresses of each printer.  Now if the printers are hosted by other workstations and are simply shared using file and printer sharing then I don't have a suggestion for you other than to contact HP or Brother or whoever makes your printers and see if they have an SDK or API that you can use to retrieve the info you need.
0
 
LVL 2

Author Comment

by:cwile
ID: 16991627
That's the problem. The printers don't have their own network cards, so the only way I can get them would be to go through the workstation they are attached to.

Thanks, I'll see what HP has to say about this.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Kane - TechSoEasy earned 500 total points
ID: 17035622
You can use HP WebJetAdmin to do this... and it's free from HP:  http://h20338.www2.hp.com/hpsub/cache/332257-0-0-225-121.html

Jeff
TechSoEasy
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 17035644
P. S.  For about $25.00 each, you can have your printers attach directly to the network instead... which makes this much easier:
http://www.overstock.com/cgi-bin/d2.cgi?PAGE=PRODUCT&PROD_ID=1099680&cid=25608&fp=F

Jeff
TechSoEasy
0
 
LVL 2

Author Comment

by:cwile
ID: 17041811
Thanks Tech, downloading that now and will see if that's what I need :)
0
 
LVL 2

Author Comment

by:cwile
ID: 17044010
Seems to only be returning my network printers.
I'll continue to fiddle with it, but I still haven't figured out how to pull the information off of laserjets attached to PCs(shared out in most cases).
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 17044085
You will need to add those print servers I linked above for it to recognize them.  They need their own IP address.

Jeff
TechSoEasy
0
 
LVL 2

Author Comment

by:cwile
ID: 17044096
Actually I got it. I just remotely installed the jetadmin onto the PC names I wanted.
Wanted to do it without client installs, but I'll live with the remote install.

Thanks,
Corey
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 17048547
oh, that'll work as long as it doesn't use up too much of the pc's resources.

Jeff
TechSoEasy
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

617 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