IPv4 Address Lists

by Apr 21, 2010

You should try this to get all IPv4 addresses assigned to your system:

Get-WMIObject win32_NetworkAdapterConfiguration |
Where-Object { $_.IPEnabled -eq $true } |
Foreach-Object { $_.IPAddress } |
Foreach-Object { [IPAddress]$_ } |
Where-Object { $_.AddressFamily -eq 'Internetwork' } |
Foreach-Object { $_.IPAddressToString }

Twitter This Tip! ReTweet this Tip!