Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Gathering Data from Printers on network

Posted on 2006-06-26
9
Medium Priority
?
229 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 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

886 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