As a system administrator, I recently faced an issue where I needed to quickly find the IP addresses assigned to various network interfaces on my Windows servers. It is easy to achieve this using PowerShell. In this tutorial, I will explain how to retrieve IP address information using PowerShell in a Windows environment.
Get IP Address Using PowerShell in Windows
PowerShell allows you to retrieve IP address information quickly with just a few commands, saving time and effort compared to navigating through GUI menus.
To get started with PowerShell IP configuration, you need to open the PowerShell console. You can do this by following these steps:
- Press the Windows key + R to open the Run dialog box.
- Type “powershell” and press Enter.
Alternatively, you can search for “PowerShell” in the Start menu and click on the Windows PowerShell app.
Retrieve IP Addresses using Get-NetIPAddress
The Get-NetIPAddress cmdlet is a powerful command introduced in Windows Server 2012 R2 that allows you to retrieve IP address configuration information. Here’s how to use it:
- Open the PowerShell console.
- Type
Get-NetIPAddressand press Enter.
This command will display all the IP addresses configured on your system, including IPv4 and IPv6 addresses, along with the associated network interfaces.
The same cmdlet will also work in Windows 11 OS. Here, you can see I executed the PowerShell script, and it displays the IP address details.

Read How to Set Service to Automatic Using PowerShell?
Filter IP Addresses
If you want to filter the output to display only specific IP addresses, you can use the Where-Object cmdlet. For example, to retrieve only IPv4 addresses, use the following command.
Get-NetIPAddress | Where-Object {$_.AddressFamily -eq "IPv4"}Here is the exact output in the screenshot below:

To filter IP addresses based on a specific network interface, you can use the InterfaceAlias property. For example, to get the IP addresses assigned to the “Ethernet” interface, use:
Get-NetIPAddress -InterfaceAlias "Ethernet"Read Change Windows 11 Desktop Background Color with PowerShell
Format the Output
PowerShell provides various formatting options to customize the output of the Get-NetIPAddress cmdlet. You can use the Format-Table cmdlet to display the output in a tabular format:
Get-NetIPAddress | Format-TableHere is the exact output in the screenshot below:

You can also select specific properties to display using the Select-Object cmdlet. For example, to display only the IP address and interface alias:
Get-NetIPAddress | Select-Object -Property IPAddress, InterfaceAliasRead Rename a Windows Computer Using PowerShell
Get an IP Address Using PowerShell – Example
Let me share a real-world example where using PowerShell to get IP addresses helped me troubleshoot a network connectivity issue.
I was working on a project for a client in New York City when they reported that one of their servers was unable to communicate with other devices on the network. To diagnose the problem, I used PowerShell to retrieve the IP address information of the problematic server.
First, I connected to the server remotely using PowerShell remoting. Then, I ran the following command to get the IP addresses:
Get-NetIPAddress | Where-Object {$_.AddressFamily -eq "IPv4"}The output revealed that the server had an incorrect IP address configuration. The IP address was outside the expected range for the network segment. Armed with this information, I was able to quickly correct the IP address settings and restore network connectivity for the server.
Conclusion
In this tutorial, I explained how to use PowerShell to retrieve IP address information in a Windows environment. The Get-NetIPAddress cmdlet is used to get IP addresses, allowing you to filter and format the output according to your needs.
You may also like:
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.