0

From what I have read its not possible to find a clients local printer using modern browsers for security reasons. I have a few conditions that might make that answer different.

  1. I am trying to get clients local printers from within a company network. So this isnt published 'outside'
  2. I thought several years ago Microsoft released a small version of .Net that could be run from the clients browser. If so and its still around I wonder if that could inspect clients local printer.

Thanks

2 Answers2

0

One way to give the appearance of retrieving the clients printers is to run a server side application in the same network with the same access permissions. Silverlight may be able to do it. I have no experience with it unfortunately.

Check here: Get list of network printers silverlight

Community
  • 1
  • 1
trevster344
  • 491
  • 2
  • 14
0

This ended up being a lot of work with little information because nearly all my searches on the internet for a solution assumed we want to get the printers of the client from the browser. We want to find such information it via the Network.

The solution ended up being with DirectorySearch and the like. here is the code with some privacy stuff removed. Its in a POF state so it might have some not so great syntax

Dim list As New List(Of String)
Dim listtemp As New List(Of String)
Dim resultCollection As SearchResultCollection
Dim computer_name As String = System.Net.Dns.GetHostEntry(Request.ServerVariables("remote_addr")).HostName.Replace(".ourcompany.com", "").ToLower  'clients machine name       
    Dim dirEntry As New DirectoryEntry("LDAP://DC=OURCOMPANY, DC=com")
    Dim dirSearcher As New DirectorySearcher(dirEntry)
    dirSearcher.Filter = "objectCategory=printQueue"
    dirSearcher.PropertyNamesOnly = True
    dirSearcher.PropertiesToLoad.Add("Name")
    dirSearcher.SearchScope = SearchScope.Subtree
    resultCollection = dirSearcher.FindAll()
    For Each sresult As SearchResult In resultCollection
        If sresult.GetDirectoryEntry.Name.ToLower.Contains(computer_name) Then
            list.Add(sresult.GetDirectoryEntry.Name.ToLower.Substring(3).Replace(computer_name + "-", ""))
        End If
    Next