Jump to content
Sign in to follow this  

Get all computers connected to the router

Recommended Posts


I have seen an application that does this:

It lists all the computers/devices connected to your internet device and it gives informations such as:



Names if it is a computer

and name of the devices(for example 1=computer 2=Mobile device iPhone 3=other devices)

I know how to get DNSdomain, hostname, ipaddress, subnet and mac address of localhost. This is not what i am searching.
I am trying to get the informations above of all the devices connected to my internet device. Ethernet and wireless.

So anyone has any ideas?

Share this post

Link to post
Share on other sites

Share this post

Link to post
Share on other sites

It depends on the router, too. I know that some routers allow you to pull this information pretty easily. The old WRT series stored the list at <router address>/DeviceList.asp, for example. I'm not sure there is an (easy, anyway) one size fits all solution.

Share this post

Link to post
Share on other sites

the easiest way is to scan the IP range. it can be scripted with AutoIt, if you insist; but there are ready-made tools for this. here are two of them i found very useful:



I'd also recommend nmap and zenmap (gui for nmap).

Share this post

Link to post
Share on other sites

Hi AutID

if you want to discover all devices in your local LAN, then you could use my >multiping udf

here a simple example of use that will scann all IP devices of your local subnet and will display result by green boxes in a listview.
then will continuosly ping those devices showing a red box when one of them will go offline.

(You need first to download the >MultiPing.au3 and save it in the same directory of this example.)

; this is to ping continuously a list of IP addresses, get and display ping result "live"
; it simulates the dos "ping -t" command but performed simultaneously on many IP
; presenting the results in a ListView highlighting not responding devices with a red box

#include <GUIConstantsEx.au3>
#include <Array.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <ListviewConstants.au3>

#include 'MultiPing.au3' ; <-- take this from the following link:
; http://www.autoitscript.com/forum/topic/156395-versatile-multi-ping

Local $IP_range = "" ; range to be pinged (leave it empty to ping all local lan)
Local $IP_mask = ""

Opt("GUIOnEventMode", 1)
HotKeySet("{esc}", "_button1")

Local $Win_X = 600, $Win_Y = 600 ; dimension of window
$PingGui = GUICreate("IP addresses monitor", $Win_X, $Win_Y, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_button1", $PingGui)
$listview = GUICtrlCreateListView("", 10, 10, $Win_X - 20, $Win_Y - 40)
GUICtrlSetFont(-1, 6)
GUICtrlSetStyle($listview, $LVS_ICON + $LVS_NOLABELWRAP)

; Generate colored square images
$hImage = _GUIImageList_Create(16, 16)
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($listview, 0xFFFF00, 16, 16)) ; yellow
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($listview, 0xFF0000, 16, 16)) ; red
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($listview, 0x00FF00, 16, 16)) ; green

_GUICtrlListView_SetImageList($listview, $hImage, 0)

$button1 = GUICtrlCreateButton("Exit", 10, $Win_Y - 25, $Win_X - 20, 20)
GUICtrlSetTip(-1, "End of program")
GUICtrlSetOnEvent(-1, "_button1")

$MyArray = _nPing($IP_range, $IP_mask, 1, 1) ;  first call is to generate the array
;                                               this will search for all active IP devices
;                                               and make a "snapshot" in the $MyArrat

_ArrayDelete($MyArray, 0) ; remove first item
; _ArrayDisplay($MyArray)
_GUICtrlListView_AddArray($listview, $MyArray) ; and fill ListView

While 1 ; continuously ping addresses of the snapshot previously generated
    _nPing($MyArray, 0, 0, 0, "_refresh") ; PING required addresses and call the _refresh() function
    ;                                        for each terminated ping (reasults of ping are passed to function)

Func _button1() ; Button 1 clicked
EndFunc   ;==>_button1

Func _refresh($Params) ; this receive ping results and displays them in the ListView
    _GUICtrlListView_SetItemImage($listview, $Params[5], 0) ; set colour to Yellow
    Sleep(50) ; a little wait
    If $Params[4] = -1 Then ; Device not responding to ping
        _GUICtrlListView_SetItemImage($listview, $Params[5], 1) ; set colour to RED
        _GUICtrlListView_EnsureVisible($listview, $Params[5]) ; Position view to this item
    Else ; Device responds to ping
        _GUICtrlListView_SetItemImage($listview, $Params[5], 2) ; set colour to GREEN
EndFunc   ;==>_refresh

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...