이 거의 정보가 많은 작업 었죠. 우리는 네트워크를 통해 그러한 정보를 찾고자합니다.
결국 솔루션은 DirectorySearch 등으로 끝났습니다. 여기에 일부 개인 정보가 삭제 된 코드가 있습니다. POF 상태이므로 일부 구문이 복잡 할 수도 있습니다.
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