Solved

Gathering Data from Printers on network

Posted on 2006-06-26
9
221 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
  • 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
 
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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 …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

17 Experts available now in Live!

Get 1:1 Help Now