Subnet Toolsand other network tips

Updated bulk MAC address lookup

In an earlier post I wrote a small powershell script to do lookups of vendor OUI. I have since updated this to use my own API which uses an up to date copy of the OUI database and now takes input of the filename of the list.

MAC addresses still need to be in a CSV with MACAddress as the column header. You can save it as get-vendor.ps1 and then call it using ./get-vendor.ps1 filename.csv

$f=$args[0]
$proxy = [System.Net.WebRequest]::GetSystemWebProxy().GetProxy("http://api.simonpainter.com/") 
$file = import-csv $f 
foreach ($line in $file) { $mac = "" $uri = "" $manufacturer="" $mac = $line.MACAddress 
$uri = "http://api.simonpainter.com/oui/v1/?mac="+$mac 
$json = Invoke-RestMethod -uri $uri -proxy $proxy -ProxyUseDefaultCredentials 
$manufacturer = $json.vendor 
$output = $mac+","+$manufacturer echo $output }

You are welcome to use the API in other applications if you wish.

Comments are currently closed.