Solved

Network Neighbourhood - my neighbours?

Posted on 2001-06-14
7
211 Views
Last Modified: 2012-05-04
Hi,

I'm Riaz.  I would like to know how to programatically (in VB) find out all the computers active on the network currently - like windows explorer shows them when you click on Network Neighbourhood.

thanx in advance
0
Comment
Question by:riaz9
7 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 6194039
0
 

Accepted Solution

by:
vbhelper earned 100 total points
ID: 6194640
NOTE: You may not see the Active DS Type Library in the list of available References. To add the Library to the list:

Click Browse.

 -Go to the Windows\System folder or WinNT\System32 folder.
 -Select the file ActiveDS.tlb.
 -From now on, the Active DS Type Library is among the list of available References.


Dim dc As IADsDomain
Dim n As IADsComputer
 
 Set dc = GetObject("WinNT://DomainName")
 dc.Filter = Array("Computer")
 For Each n In dc
    Debug.Print n.Name
 
 Next
 Set dc = Nothing
 Set n = Nothing

Cheer's
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6194710
vbhelper, you are not new to EE so you should be fully aware of the guidelines on comments vs answers. Whilst your "answer" does indeed contribute to this thread it cannot be construed as the 100% definitive solution. Please restrain from posting "answers" in this manner or your account will be referred to customer services for possible penalty. I would ask you to withdraw your answer but as this is currently not available I would hope that your answer is rejected and considered fairly with the posts from hongjun. IMO the MVPS link provides a fast and efficient solution to this without having to install additional components such as the ADSI stuff. You are fully aware that the questioner may accept any comment as an answer at any time and as such your posting of an answer is in fact irrelevant. All that it achieves is to move the question into the locked area thus reducing the chance of other experts to contribute.
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 33

Expert Comment

by:hongjun
ID: 6195798
vbhelper, yours work only on NT version. Use my first link which will work for all windows version.

hongjun
0
 
LVL 27

Expert Comment

by:Ark
ID: 6197418
Hi
Add listbox to your form:

Private Sub Form_Load()
  Const ssfNETWORK = &H12
  Dim oShell, fld, fldItm
  Set oShell = CreateObject("Shell.Application")
  Set fld = oShell.NameSpace(ssfNETWORK)
  For Each fldItm In fld.Items
     List1.AddItem fldItm.Name
  Next
  Set fldItm = Nothing
  Set fld = Nothing
  Set oShell = Nothing
End Sub

Cheers
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6199297
riaz9, you got to reply.

hongjun
0
 
LVL 1

Author Comment

by:riaz9
ID: 6217220
thanx for the all the help
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB 6.0 printer how to align 6 62
MsgBox 2 54
How to produce a SHA-1 hash function in vb6 in order to save it to a table 8 42
Set email body to html using vbscript 6 41
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question