guide · static export
PC · networking

Discover Every Device on Your LAN with ARP

A ping sweep plus the neighbour table lists every device that answers on your subnet, including the ones with no friendly name. Resolve the MAC addresses to vendors and find the unknown box.

by@guidox updated:10/31/26 time:10 min level:Intermediate tested on:Windows 11 24H2 works on:Windows 10, Windows 11, Windows Server 2019 tools:PowerShell
TL;DR

Sweep the subnet with **Test-Connection -Count 1** in parallel, then read **Get-NetNeighbor** for the MAC addresses. A MAC prefix lookup names the vendor, which is usually enough to identify the device.

Before you start

Requirements

  • A PC on the subnet you want to scan
  • PowerShell 5.1 or later
  • 10 minutes
Step by step

Instructions

01

Find the subnet you are actually on

**Get-NetIPAddress** shows the prefix length next to the address, and the prefix length is what defines the sweep range. A /24 has 254 hosts, a /16 has 65 534 and should be split.

Get-NetIPConfiguration | Select-Object InterfaceAlias,IPv4Address,IPv4DefaultGateway
Get-NetIPAddress -AddressFamily IPv4 | Where-Object PrefixOrigin -ne 'WellKnown' | Select-Object IPAddress,PrefixLength,InterfaceAlias
02

Sweep the range in parallel

**Test-Connection -Count 1** fills the neighbour cache without waiting for a full timeout each time. The job runs 50 targets at once, which turns minutes into seconds.

$subnet = '192.168.1.'
1..254 | ForEach-Object -Parallel { if (Test-Connection -TargetName ($using:subnet + $_) -Count 1 -Quiet -TimeoutSeconds 1) { $using:subnet + $_ } } -ThrottleLimit 50 | Sort-Object
03

Read the neighbour table

**Get-NetNeighbor** is the modern arp -a. The Reachable and Stale states both mean the entry is real; only Unreachable and Incomplete are noise.

Get-NetNeighbor -AddressFamily IPv4 | Where-Object { $_.IPAddress -like '192.168.1.*' -and $_.State -in 'Reachable','Stale','Permanent' } | Sort-Object IPAddress | Select-Object IPAddress,LinkLayerAddress,State
04

Resolve the ones with a name

Reverse DNS names printers, NAS boxes and managed switches that register themselves. The query is cheap, and a failure means the device has no name record.

Get-NetNeighbor -AddressFamily IPv4 | Where-Object { $_.IPAddress -like '192.168.1.*' -and $_.State -ne 'Unreachable' } | ForEach-Object { $n = try { (Resolve-DnsName -Name $_.IPAddress -Type PTR -DnsOnly -ErrorAction Stop).NameHost } catch { 'no-name' }; [pscustomobject]@{ IP = $_.IPAddress; Name = $n; MAC = $_.LinkLayerAddress } } | Sort-Object IP | Format-Table -AutoSize
05

Name the vendor from the MAC prefix

The first three bytes of a MAC identify the manufacturer. A short prefix table covers the common consumer brands, and the rest is lookup work in any public OUI database.

$oui = @{ 'B827EB'='Raspberry Pi'; '001132'='Synology'; '3C5AB4'='Google'; 'F4F5D8'='Amazon'; 'D8BBC1'='Huawei'; '001A11'='Google' }
Get-NetNeighbor -AddressFamily IPv4 | Where-Object { $_.IPAddress -like '192.168.1.*' -and $_.LinkLayerAddress -ne 'FF-FF-FF-FF-FF-FF' } | ForEach-Object { $p = ($_.LinkLayerAddress -replace '-','').Substring(0,6).ToUpper(); [pscustomobject]@{ IP = $_.IPAddress; MAC = $_.LinkLayerAddress; Vendor = if ($oui[$p]) { $oui[$p] } else { 'unknown' } } } | Sort-Object IP | Format-Table -AutoSize
06

Identify an unknown device without touching it

Open ports tell you what a box is without logging into it. **Test-NetConnection** on the usual management ports answers in a second, and a hostname from NetBIOS or LLMNR often follows.

Test-NetConnection -ComputerName 192.168.1.42 -Port 80,443,22,445,9100 -InformationLevel Quiet
Get-NetNeighbor -IPAddress 192.168.1.42 | Select-Object IPAddress,LinkLayerAddress,State
tracert -h 3 192.168.1.42
⚠ warningScanning a network you do not own is not a friendly act. Keep this to your own subnet and your own devices.
Troubleshooting

Common issues

Most devices show as Stale

Stale entries are valid but the host has not been contacted recently. Ping the address once and the state flips back to Reachable.

The sweep finds nothing beyond the gateway

The adapter is on a different VLAN or the guest network isolates clients. Check Get-NetIPConfiguration and the router's client isolation setting.

MAC addresses are all identical

You are behind a bridge or a router that performs proxy ARP, for example a Wi-Fi extender. Scan from a device on the same segment as the target.

Get-NetNeighbor returns no LinkLayerAddress

The entry came from a tunnel or the interface is not Ethernet. Filter on InterfaceAlias to the physical adapter.

FAQ

Frequently asked

Can I see devices that block ping?

Not with a ping sweep. Those still appear in the neighbour table after any traffic, and your router's DHCP lease list is the more reliable source for them.

Why do some devices have two IP addresses?

One is IPv4 and one is the link-local IPv6 address, or the device has both a wired and a wireless interface. Compare the MAC addresses to tell them apart.

Does this work on a corporate network?

The commands run, but port scans and sweeps usually violate policy there. Ask the network team for the inventory instead.

How to undo this

Nothing is changed on the network by scanning. Clear the local cache with Clear-NetNeighbor -AddressFamily IPv4 if you want the neighbour table empty again.

Changelog · 1 entry
  1. 2026-10-31
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress