List IP addresses and lease origins on Windows (Get-NetIPAddress)
Dump every configured IP address with prefix length and how it was assigned (DHCP, manual, APIPA) as filterable PowerShell objects.
01Command
$ Get-NetIPAddress -AddressFamily IPv4 | Format-Table InterfaceAlias,IPAddress,PrefixLength,PrefixOrigin,SuffixOrigin -AutoSize02What it does
Beyond what ipconfig prints, Get-NetIPAddress exposes PrefixOrigin and SuffixOrigin (Dhcp, Manual, Other), which tells you instantly whether an address came from DHCP or was set by hand — Other on a DHCP interface means APIPA 169.254 fallback. PrefixOrigin is the quick diagnosis when 'I didn't set a static IP' arguments start. Its counterpart New-NetIPAddress / Set-NetIPAddress configures addresses statically.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Get-NetIPAddress | Microsoft LearnEvidence: Microsoft documents Get-NetIPAddress as retrieving IP address configuration including address, prefix length, and origin/valid lifetime properties.
Last verified: 2026-09-17 · Category: Network
06Related solutions
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.
The PowerShell-native replacement for netstat: filter connections by state, port, or process and pipe results instead of parsing text.
The modern, scriptable replacement for nslookup: ask for exact record types, hit specific DNS servers, and see TTLs as objects.