Created
February 9, 2017 01:10
-
-
Save Pyromaniaxxx/b6c518d12d4525dce1a4733016b4ba4b to your computer and use it in GitHub Desktop.
ARPして帰ってきたMACアドレスからベンダー名を調べて一覧表示するやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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