saber que nombre de maquinas estan en mi red
Como puedo saber que nombre de maquinas estan en mi red.....
Si en mi grupo de trabajo hay 4 maquinas como puedo saber cuales son, desde VB.NET vbForm
de antemano Gracias
Si en mi grupo de trabajo hay 4 maquinas como puedo saber cuales son, desde VB.NET vbForm
de antemano Gracias
Puedes usar con un comando del sistema de esta forma
en XP y creo ke en 2000
NET VIEW > "C:Archivo.txt"
te crea un archivo con los nombre de los equipos que estan en la red. y de ahi lo lees nadamas el archivo, esa podria ser una. la otra es con este codigo:
'Displays all computer names in an Active Directory
Imports System
Imports System.DirectoryServices
Namespace ActiveDirectorySearch1
Class Class1
Shared Sub Main(ByVal args() As String)
'Note : microsoft is the name of my domain for testing purposes.
Dim enTry As DirectoryEnTry = New DirectoryEnTry("LDAP://microsoft")
Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
mySearcher.Filter = ("(objectClass=computer)")
Console.WriteLine("Listing of computers
in the Active Directory")
Console.WriteLine("===========
===========")
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll()
Console.WriteLine(resEnt.GetDirectoryEnTry().Name.ToString())
Next
Console.WriteLine("=========== End of Listing =============")
End Sub
End Class
End Namespace
Espero y te sirva de algo
en XP y creo ke en 2000
NET VIEW > "C:Archivo.txt"
te crea un archivo con los nombre de los equipos que estan en la red. y de ahi lo lees nadamas el archivo, esa podria ser una. la otra es con este codigo:
'Displays all computer names in an Active Directory
Imports System
Imports System.DirectoryServices
Namespace ActiveDirectorySearch1
Class Class1
Shared Sub Main(ByVal args() As String)
'Note : microsoft is the name of my domain for testing purposes.
Dim enTry As DirectoryEnTry = New DirectoryEnTry("LDAP://microsoft")
Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
mySearcher.Filter = ("(objectClass=computer)")
Console.WriteLine("Listing of computers
in the Active Directory")
Console.WriteLine("===========
===========")
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll()
Console.WriteLine(resEnt.GetDirectoryEnTry().Name.ToString())
Next
Console.WriteLine("=========== End of Listing =============")
End Sub
End Class
End Namespace
Espero y te sirva de algo
