Por favor, encontre a função abaixo que irá obter o IP e o nome do computador. Altere seu alcance para o IP.
Ele fará o ping de cada IP e descobrirá a resposta.
Public Function mCheckThroughWMIQuery() As String
Dim oWMI = GetObject("winmgmts:")
Dim IP = GetObject("winmgmts:")
Dim oPings = GetObject("winmgmts:")
Dim PcName = GetObject("winmgmts:")
Dim sResult As String = ""
For i = 70 To 100
IP = "192.168.1." + i.ToString
oPings = oWMI.ExecQuery("Select * from WIN32_Pingstatus where address='" + IP + "'" + " and ResponseTime > 0")
For Each oPing In oPings
Try
PcName = System.Net.Dns.GetHostEntry(IP)
sResult &= IP & Chr(9) & PcName.HostName & vbNewLine
Catch ex As Exception
sResult &= IP & vbNewLine
End Try
Next
Next
Return sResult
End Function