Is there a command in PowerShell to retrieve MAC IP information

I want to have a simple command to resolve a MAC address to an IP address. Is it possible? I know the MAC address I'm looking for to get the IP address.

+4
source share
3 answers

This will give if the IP address , if you already have a MAC / IP score in the ARP table:

arp -a | select-string "00-1c-87-c0-1c-5d" |% { $_.ToString().Trim().Split(" ")[0] } 

returns

 192.168.10.95 

If you don't have an entry in your ARP table, I don't think there is an easy way to do this.

One way is to install arping and call it the same way from the Powershell script.

+6
source

This link describes how to use arp on the command line for this. You can also use the Win32_NetworkAdapterConfiguration WMI object to do this directly from PowerShell.

0
source

Get-NetNeighbor allows you to get IP addresses from MAC addresses if they are present in the ARP cache. For instance:

 Get-NetNeighbor -LinkLayerAddress ff-ff-ff-ff-ff-ff 

will list all IP addresses with a MAC address equal to FF-FF-FF-FF-FF-FF .

0
source

Source: https://habr.com/ru/post/1338188/


All Articles