Getting Assigned IP Addresses

You should use this to retrieve all IP addresses assigned to your computer:

Get-WMIObject win32_NetworkAdapterConfiguration |
Where-Object {$_.IPEnabled -eq $true } |
Foreach-Object { $_.IPAddress }
Get-WMIObject win32_NetworkAdapterConfiguration |
Where-Object {$_.IPEnabled -eq $true } |
Foreach-Object { $_.IPAddress }

You can also access remote systems and check their IP addresses since Get-WMIObject supports the -ComputerName parameter.

Twitter This Tip! ReTweet this Tip!


Posted Apr 20 2010, 08:00 AM by ps1

Comments

Twitter Trackbacks for List Assigned IP Addresses from #PowerShell [powershell.com] on Topsy.com wrote Twitter Trackbacks for List Assigned IP Addresses from #PowerShell [powershell.com] on Topsy.com
on 04-20-2010 10:39 AM

Pingback from  Twitter Trackbacks for                 List Assigned IP Addresses from #PowerShell         [powershell.com]        on Topsy.com

Cruisader03 wrote re: Getting Assigned IP Addresses
on 04-20-2010 12:35 PM

Why not let GWMI filter more efficiently?

Get-WMIObject win32_NetworkAdapterConfiguration -filter "IPEnabled = $true" |

Foreach-Object { $_.IPAddress }

which is the best dedicated server / managed hosting service out there? | Host Rage wrote which is the best dedicated server / managed hosting service out there? | Host Rage
on 04-21-2010 2:06 AM

Pingback from  which is the best dedicated server / managed hosting service out there? | Host Rage

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

Pingback from  IPconfig in PowerShell | TechProsaic

giganews wrote re: Getting Assigned IP Addresses
on 06-07-2011 2:21 PM

This information is helpful.  Knowing your IP address is very important for multiple reasons.  It can help to fix some network related issues that may arise.  Also, having a log of all activity on your IPs can be help to keep track of your employees, their internet habits, and could help you to recover in the event of a major IT failure.

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