troubleshooting Question

How do I get a list of all the printers on a network?

Avatar of Chris333
Chris333 asked on
Visual Basic.NET
4 Comments1 Solution660 ViewsLast Modified:
I have an odd customer requirement that they can be able to print from a desktop app to any printer on their network in any of their domains without a driver. I have this working; the problem that I am having is in retrieving a list of all the printers on the network.   I have tried the API functions and I tried this code also.

 Dim moReturn As Management.ManagementObjectCollection

        Dim moSearch As Management.ManagementObjectSearcher

        Dim mo As Management.ManagementObject

        moSearch = New Management.ManagementObjectSearcher("Select * from Win32_Printer")

        moReturn = moSearch.Get
        Dim i = moSearch.Get.Count
        Dim s = moSearch.ToString()
       
        For Each mo In moReturn

            Dim objReturn As Object
            Dim test = mo("Name").ToString()
            ComboBox1.Items.Add(test)

        Next

But I only get the printers registered to my machine.

Any help would be appreciated thank you.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros