Results 1 to 3 of 3

Thread: Find networked computers

  1. #1

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    Is there a way to go out and search for all computers
    on the network you are currently on and get the names of them?


    Thanks in advance

    Bababooey
    Tatatoothy
    Mamamonkey

  2. #2
    Addicted Member Babbalouie's Avatar
    Join Date
    Jan 2001
    Location
    On the bright, blue sea...
    Posts
    197
    Code:
    Public Function GetComputersInADomain(aryUsers() As String) As Long
    
        'Notes:  Requires a global array to be pased in if list of users wanted
        'Notes:  Very slow if domain name not valid
        'Notes:  Must set reference to Active DS Type Library for this to work
        
    Dim TheDomain As IADsDomain
    Dim Computer As IADsComputer
    Dim strDomain As String
    Dim x As Long
    
        'Accept the Domain name
        strDomain = InputBox("Domain Name: ")
    
        'Use the WinNT Directory Services
        strDomain = "WinNT://" & strDomain
    
        'Create the Domain object
        Set TheDomain = GetObject(strDomain)
    
        'Search for Computers in the Domain
        TheDomain.Filter = Array("Computer")
    
        'Enumerate each computer in the domain
        For Each Computer In TheDomain
            x = x + 1
            ReDim Preserve aryUsers(x)
            aryUsers(x) = Computer.NAME
        Next Computer
    
        'Clean up
        GetComputersInADomain = x
        Set Computer = Nothing
        Set TheDomain = Nothing
    
    End Function
    Building A Better Body Albeit Left Out Under Intense Extrapolation

  3. #3

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    thank you very much bababooey
    Bababooey
    Tatatoothy
    Mamamonkey

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