Home » PowerShell » PowerShell: Finding neighbors with Get-NetNeighbor

PowerShell: Finding neighbors with Get-NetNeighbor

Do you know your neighbors? I mean the neighbors in the real word. I hope so. But what about the virtual neighbors? The PowerShell module NetTCPIP provides a command called Get-NetNeighbor. In this article i use this command to play with neighbor discovery to find all my cached neighbors sharing the same link. 


First check out the Interface ID (ifIndex) or name of your network adapter.



Get-NetNeighbor in Action


Get-NetNeighbor -InterfaceAlias "Ethernet 2" -AddressFamily IPv4



Get-NetNeighbor -InterfaceAlias "Ethernet 2" -AddressFamily IPv6


Show all IPv4 neighbors except broadcast addresses and multicast addresses

Get-NetNeighbor -AddressFamily IPv4 | Where-Object {($_.IPAddress -like "192.168.0.*") -and ($_.IPAddress -ne "")}


Show all IPv6 neighbors except multicast addresses

For communication on the same link Link-Local Adresses are used. To show all IPv6 neighbors with Link-Local Addresses run

Get-NetNeighbor -IPAddress fe80* -AddressFamily Ipv6


Have fun discovering your neighbors! 😉 Also see my article: The modern version of ping: Test-Connection.

1 Comment

  1. […] Test-Connection is for testing the connectivity to a remote host. For information about your directly connected neighbors on a shared link please read my article PowerShell: Finding neighbors with Get-NetNeighbor. […]


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Who is the blogger?

My name is Patrick Grünauer (pewa2303). I am from Austria. On sid-500 I write about Windows, Cisco and IT-Security in English and German. Have fun while reading!

Patrick Gruenauer
Follow SID-500 on