If you can use ADSI it is as easy as:
DirectorySearcher src = new DirectorySearcher("(objectClass=computer)");
foreach(SearchResult res in src.FindAll())
{
Console.WriteLine(res.Path);
}
--------------------
| From: "Moukarram Kabbash" <
[email protected]>
| Subject: Listing neighbor computers
| Date: Thu, 5 Feb 2004 11:50:13 +0100
| Lines: 7
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: vpw.wh.uni-dortmund.de 129.217.129.134
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.
phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:123777
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Hello everybody,
|
| how can I get the names of all neighbor computers in my local network ?
|
| Thanks in advance
|
|
|