Skip to content

Instantly share code, notes, and snippets.

@Pyromaniaxxx
Created February 9, 2017 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pyromaniaxxx/b6c518d12d4525dce1a4733016b4ba4b to your computer and use it in GitHub Desktop.
Save Pyromaniaxxx/b6c518d12d4525dce1a4733016b4ba4b to your computer and use it in GitHub Desktop.
ARPして帰ってきたMACアドレスからベンダー名を調べて一覧表示するやつ
function Convert-MacToVender ($Mac ,$IP)
{
try
{
"$Mac : $IP : " + (Invoke-WebRequest -Uri ("http://api.macvendors.com/$Mac"))
}
catch [System.Net.WebException],[System.Exception]
{
"$Mac : $IP :"
}
}
Get-NetNeighbor -AddressFamily IPv4 | ForEach-Object {Convert-MacToVender $_.LinkLayerAddress $_.IPAddress }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment