You can type the "net view" DOS command to get the list of computers or shared resources in your workgroup. If you want to achieve a similar thing in the code the following example can help.
references to your project and import them. The following code lists all "computers" in your domain.
Public Function GetComputers() As String
Dim result As String = ""
Dim ipproperties As NetworkInformation.IPGlobalProperties = NetworkInformation.IPGlobalProperties.GetIPGlobalProperties()
Dim domain As String = ipproperties.DomainName
Dim domainEntry As DirectoryEntry = New DirectoryEntry("WinNT://" + domain)
For Each computer As DirectoryEntry In domainEntry.Children
result = result & computer.Name & Environment.NewLine
If you want to get the list of users instead of computers then change the line containing
For more tips for Microsoft developers see my blog: http://morrisbahrami.blogspot.com