Getting MAC Vendor List

by Aug 21, 2017

Prateek Singh has invested some effort in creating a sanitized MAC vendor address list in CSV format which can be found in his blog (https://geekeefy.wordpress.com/2017/07/06/get-mac-vendor-using-powershell/). Such lists can be very useful to identify the vendor of network devices by looking at their MAC addresses.

Using PowerShell, you can easily download it to your computer:

#requires -Version 3.0

$url = 'http://goo.gl/VG9XdU'
$target = "$home\Documents\macvendor.csv"
Invoke-WebRequest -Uri $url -UseBasicParsing -OutFile $target

$content = Import-Csv -Path $target
$content | Out-GridView

With this awesome list, you can now take the first three numbers of any MAC address and find its manufacturer. Here is a simple sample implementation taking the information from Get-NetAdapter, and adding Manufacturer info:

#requires -Modules NetAdapter
#requires -Version 4.0

$url = 'http://goo.gl/VG9XdU'
$target = "$home\Documents\macvendor.csv"
$exists = Test-Path -Path $target
if (!$exists)
{
    Invoke-WebRequest -Uri $url -UseBasicParsing -OutFile $target
}

$content = Import-Csv -Path $target

Get-NetAdapter |
  ForEach-Object {
      $macString = $_.MacAddress.SubString(0, 8).Replace('-','')
      $manufacturer = $content.
      Where{$_.Assignment -like "*$macString*"}.
      Foreach{$_.ManufacturerName}

        $_ | 
            Add-Member -MemberType NoteProperty -Name Manufacturer -Value $manufacturer[0] -PassThru |
            Select-Object -Property Name, Mac*, Manufacturer  
  }

Twitter This Tip! ReTweet this Tip!