My most used CMD utility is probably ipconfig
. Need the IP address? Just crack open a command prompt window, slap in ipconfig
, hit enter, and you’re done. But PowerShell offers a new alternative to the ipconfig
command: Get-NetIPConfiguration
. It provides detailed IP address and interface data in a more structured, scriptable format. While ipconfig
still works in PowerShell, native cmdlets like Get-NetIPAddress
offer far more flexibility for admins automating tasks.
Of course, there are other methods you could use to get the IP address of a computer. You could check the address leases on your DHCP server, the entries on your DNS server, or the network configuration settings in the control panel. Or you could just look it up in PDQ Connect or PDQ Inventory.
What’s the difference between CMD and PowerShell?
Don’t be confused: Just because CMD and PowerShell can run many of the same commands doesn’t mean these two shells are the same. There really is no comparison here.
PowerShell is drastically more powerful than CMD. It can do everything CMD can do and so much more. PowerShell is a scripting language built on the .NET Framework, and it has access to all of the .NET libraries. Nearly everything in PowerShell is an object with properties and methods, which can be called and manipulated.
Administrators can use PowerShell to manage almost every part of the Windows environment and automate complex administrative tasks. Command prompt, by comparison, is not an object-oriented language and is very limited, with a much smaller set of commands and functions that it can perform.
Want to increase your PowerShell knowledge?
Tune into The PowerShell Podcast, where PowerShell experts share their tips, tricks, and best practices.
Can I use ipconfig in PowerShell?
I always like to get this out of the way first: Many of the CMD commands you know and love still work in PowerShell. Go ahead, try it.

Again, since PowerShell can use almost all of the old CMD commands, you should really stop procrastinating and make the switch.
Using the old command is fine, and at least it can get you comfortable launching PowerShell by default instead of CMD. However, to make the most out of PowerShell, you need to use the proper PowerShell commands. For ipconfig
, we have a couple of PowerShell options to use, so let’s break down each.
Easily run PowerShell scripts on remote devices
Need to run your awesome PowerShell scripts on remote devices? PDQ Connect can easily execute PowerShell scripts on any managed device with an active internet connection.
What is the PowerShell equivalent of ipconfig?
Let’s first take a look at the PowerShell option that the most closely resembles the functionality and results of ipconfig
, Get-NetIPConfiguration
.
NAME
Get-NetIPAddress
SYNOPSIS
Gets the IP address configuration.
SYNTAX
Get-NetIPAddress [[-IPAddress] <String[]>] [-AddressFamily <AddressFamily[]>] [-AddressState <AddressState[]>] [-AssociatedIPInterface <CimInstance>] [-CimSession <CimSession[]>] [-IncludeAllCompartments] [-InterfaceAlias<String[]>] [-InterfaceIndex <UInt32[]>] [-PolicyStore <String>] [-PreferredLifetime <TimeSpan[]>] [-PrefixLength <Byte[]>] [-PrefixOrigin <PrefixOrigin[]>] [-SkipAsSource <Boolean[]>] [-SuffixOrigin <SuffixOrigin[]>] [-ThrottleLimit <Int32>] [-Type <Type[]>] [-ValidLifetime <TimeSpan[]>] [<CommonParameters>]
DESCRIPTION
The Get-NetIPAddress cmdlet gets the IP address configuration, such as IPv4 addresses, IPv6 addresses and the IP interfaces with which addresses are associated. Without parameters, this cmdlet gets the entire IP address configuration for the computer.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=288380
Get-NetRoute
New-NetIPAddress
Remove-NetIPAddress
Set-NetIPAddress
REMARKS
To see the examples, type: "get-help Get-NetIPAddress -examples".
For more information, type: "get-help Get-NetIPAddress -detailed".
For technical information, type: "get-help Get-NetIPAddress -full".
For online help, type: "get-help Get-NetIPAddress -online"
Here’s a comparison between the data returned with ipconfig
versus the data returned with Get-NetIPConfiguration
.

As the description says, Get-NetIPConfiguration
returns networking configuration, including usable interfaces, IP addresses, and DNS servers. This command by itself returns all of the non-virtual connected interfaces on the computer. If you want to return the virtual interfaces, you need to include the -All
parameter.
Now let’s look at the cmdlet Get-NetIPAddress
, which returns IPv4 and IPv6 configuration data and information about the interfaces those addresses are associated with.
NAME
Get-NetIPAddress
SYNOPSIS
Gets the IP address configuration.
SYNTAX
Get-NetIPAddress [[-IPAddress] <String[]>] [-AddressFamily <AddressFamily[]>] [-AddressState <AddressState[]>] [-AssociatedIPInterface <CimInstance>] [-CimSession <CimSession[]>] [-IncludeAllCompartments] [-InterfaceAlias<String[]>] [-InterfaceIndex <UInt32[]>] [-PolicyStore <String>] [-PreferredLifetime <TimeSpan[]>] [-PrefixLength <Byte[]>] [-PrefixOrigin <PrefixOrigin[]>] [-SkipAsSource <Boolean[]>] [-SuffixOrigin <SuffixOrigin[]>] [-ThrottleLimit <Int32>] [-Type <Type[]>] [-ValidLifetime <TimeSpan[]>] [<CommonParameters>]
DESCRIPTION
The Get-NetIPAddress cmdlet gets the IP address configuration, such as IPv4 addresses, IPv6 addresses and the IP interfaces with which addresses are associated. Without parameters, this cmdlet gets the entire IP address configuration for the computer.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=288380
Get-NetRoute
New-NetIPAddress
Remove-NetIPAddress
Set-NetIPAddress
REMARKS
To see the examples, type: "get-help Get-NetIPAddress -examples".
For more information, type: "get-help Get-NetIPAddress -detailed".
For technical information, type: "get-help Get-NetIPAddress -full".
For online help, type: "get-help Get-NetIPAddress -online"
Here is a comparison of the returned data.

Notice that the PowerShell cmdlet returned much more information about this device’s associated IP addresses, even including the loopback or localhost address. I cropped this image because of the amount of data returned, but I’ll show you how to return this information in a much more digestible format.
Get-NetIPConfiguration and Get-NetIPAddress examples
Armed with this new PowerShell knowledge, let’s look at some practical examples and use cases.
Get-NetIPConfiguration example 1
Get-NetIPConfiguration | Select-Object -Property IPv4Address

This example returns just the IPv4 address of the local computer. Since I’m usually looking for the IPv4 address when I run this command, it ignores the other properties and only returns the IPv4 address property.
To understand how this command works, let’s first talk about the “|” symbol. This symbol is the vertical bar or pipe symbol. It allows you to pipe or pass results from one cmdlet to another. In this case, we are passing on the results of Get-NetIPConfiguration
to the Select-Object
cmdlet. The Select-Object
cmdlet allows you to select specific properties of an object. I’ve used the -Property
parameter to target only the IPv4Address property.
Get-NetIPConfiguration example 2
Get-NetIPConfiguration -Computer “computer-name” | Select-Object -Property IPv4Address
This example returns the IPv4Address of a remote computer. We are using the -Computer
parameter to specify a remote host.
For this example to work, you need to ensure that PowerShell remoting is enabled. You can check to see if this is enabled on the remote machine by running the command Get-Service “
Winrm
”
. If it’s not configured, you can run Winrm quickconfig, which should enable the service for you. If you need to allow PowerShell remoting on several machines or you want to enable it on your entire domain, your best bet is to configure it through Group Policy.
Get-NetIPAddress example 1
Get-NetIPAddress | Format-Table

Like I mentioned previously, Get-NetIPAddress
can end up returning a lot of information and not in a format that’s easy to read. To solve this, we can pipe the results of the Get-NetIPAddress
cmdlet to the Format-Table
cmdlet, which, as the name suggests, displays the resultant data in an easy-to-digest table format. Just a heads-up, once you format this data into a table, you can no longer interact with it.
Get-NetIPAddress example 2
$list = "computer1", "computer2", "computer3"
$Array = New-Object System.Collections.ArrayList
Foreach ($Machine in $list){
$result = Get-NetIPAddress -CimSession $Machine -PrefixOrigin Dhcp
$Array.Add($result) | Out-Null
}
$Array | Select PSComputerName, IPAddress

This example takes things to the next level so let’s unpack it and see what’s going on.
First, we are assigning three computers to the $list
variable. Next, we create a variable called $Array
and configure it as an array object with New-Object System.Collections.ArrayList
. Then, we start our Foreach
loop, which uses a placeholder variable called $Machine
to contain an individual item from the $list
variable while running through the loop.
Next, we create a variable named $result, which contains the results from the Get-NetIPAddress
cmdlet. We’ve added the -CimSession
parameter that connects to the remote computer currently assigned to the placeholder variable $Machine
. We’ve used the parameter -PrefixOrigin
to single out only IP addresses with the prefix origin of Dhcp.
Next, we add the $result
variable to the $Array
with $Array.Add($result)
and pipe that to Out-Null
to stop the array from printing output while assigning results. Lastly, we call the array to show the resultant data but only display the PSComputerName
and IPAddress
to keep our results nice and clean.
This script is pretty versatile and could easily be modified to return the IP addresses of all the computers in a specified OU versus just manually inputting computer names. As a word of caution, if you run this script against a computer that is not online, it throws an error, but the script continues to run. The end result will be a duplicate entry in the array.
If you haven’t already, now’s the time to start learning PowerShell. As its name implies, it’s a very powerful tool that can help you manage and even automate many of your sysadmin responsibilities.
If you’re interested in other tools that can help manage or automate your tasks (yes, even patch management), you should check out PDQ Connect or PDQ Deploy & PDQ Inventory. Priced to fit any budget, these tools collect hardware, software, and Windows configuration data and automate your package deployments to keep your machines always up to date. You can try them out for yourself with a free 14-day trial.