CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Machine Names

  1. #1
    Join Date
    Jul 2001
    Posts
    5

    Machine Names

    Hi,

    Is it possible to display the names of all the online machines that are connected to a network using VB.Net

  2. #2
    Join Date
    Jan 2003
    Location
    London/Moscow
    Posts
    60
    I have never worked with it but i think you have to use active directory service

  3. #3
    Join Date
    Mar 2005
    Posts
    1

    Re: Machine Names

    Imports System
    Imports System.DirectoryServices

    Namespace ActiveDirectorySearch1
    Class Class1
    Shared Sub Main(ByVal args() As String)
    'Note : microsoft is the name of my domain for testing purposes.
    Dim enTry As DirectoryEnTry = New DirectoryEnTry("LDAP://microsoft")
    Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
    mySearcher.Filter = ("(objectClass=computer)")
    Console.WriteLine("Listing of computers n the Active Directory")
    Console.WriteLine("=========== ===========")
    Dim resEnt As SearchResult
    For Each resEnt In mySearcher.FindAll()
    Console.WriteLine(resEnt.GetDirectoryEnTry().Name.ToString())
    Next
    Console.WriteLine("=========== End of Listing =============")
    End Sub
    End Class
    End Namespace

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured