Solved

Network Neighbourhood - my neighbours?

Posted on 2001-06-14
7
206 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now