[cisco-voip] sn# search

Robert Kulagowski bob at smalltime.com
Wed Jan 24 21:35:47 EST 2007


Robert Kulagowski wrote:
> As far as I know, no, there isn't.  I wrote a VBScript file in Excel 
> that essentially hits every IP address in a /24 and pulls the phone's 
> web page, then parses the result for the serial number.  I'll post it 
> shortly.

Here it is.  Totally brainless, but a quick hack that Works Good Enough.

Sub log()

Dim xml
  Set xml = CreateObject("Microsoft.XMLHTTP")

sitecode = 101
For lastoctet = 2 To 254

  On Error Resume Next

ipaddress = "192.168." & sitecode & "." & lastoctet
macaddress = ""
serialnumber = ""
sURL = "http://" & ipaddress

xml.Open "GET", sURL, False
xml.Send
xmlDoc = xml.responseText

If xmlDoc = "" Then
macaddress = "not connected"
Else
macaddress = Mid(xmlDoc, InStr(xmlDoc, "MAC Address") + 45, 12)
serialnumber = Mid(xmlDoc, InStr(xmlDoc, "Serial Number") + 47, 11)
End If

Worksheets(1).Cells(lastoctet, 1) = ipaddress
Worksheets(1).Cells(lastoctet, 2) = macaddress
Worksheets(1).Cells(lastoctet, 3) = serialnumber

Next lastoctet

End Sub




More information about the cisco-voip mailing list