Solved

Gathering Data from Printers on network

Posted on 2006-06-26
9
223 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

777 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