1

I am using visual studio 2010 and I have searched on the net for help and other people using the DirectoryEntry("WinNT:") but it doesn't seem to work for me. I can see my network workgroups and if I use DirectoryEntry("WinNT://MYWORKGROUP") I can't see any computers listed.

Please help I am not sure why it isn't working for me.

Thanks

csharpguy76
  • 121
  • 1
  • 3

2 Answers2

2

Getting computer names from my network places:

Do not use DirectoryServices unless your sure of a domain environment. The System.DirectoryServices class is an ADSI wrapper that dosent work without an Active Directory to query against. NetServerEnum() works on workgroups and domains but dosen't guarantee the most reliable data (not all machines may show up). It relies on the Computer Browser service.

Community
  • 1
  • 1
Ria
  • 10,237
  • 3
  • 33
  • 60
1

To browse the local Windows network, NetBIOS name resolution must be running and correctly configured. In a corporate network that often means the presence of a WINS server. The required components are not enabled by default on modern Windows installations.

Before trying to do anything from your own code, ensure that the infrastructure is in place. Open Windows Explorer and expand the "Network" node. If name Windows browsing is correctly you should see the list of computers on the network there. If the list is empty, the problem isn't in your code.

Anders Abel
  • 67,989
  • 17
  • 150
  • 217