Solved

Gathering Data from Printers on network

Posted on 2006-06-26
9
222 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Encryption Decryption in Oracle 12 105
Set form below another form 3 35
Enable copy and pasting even when textbox is disabled 2 26
Setting runtime form location 4 29
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A short film showing how OnPage and Connectwise integration works.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

911 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

23 Experts available now in Live!

Get 1:1 Help Now