IPv4 Address Lists

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!


Posted Apr 21 2010, 08:00 AM by ps1

Comments

IPconfig in PowerShell | TechProsaic wrote IPconfig in PowerShell | TechProsaic
on 04-21-2010 8:15 AM

Pingback from  IPconfig in PowerShell | TechProsaic

dimepop wrote re: IPv4 Address Lists
on 05-11-2011 5:51 AM

Is it possible to get the IP from just the LAN Adapter?

It currently shows boththe Wireless and LAN

How do i apply the filter to this script?

thanks

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.