PowerShell Logo Small

Get-NetIPAddress



This is the built-in help made by Microsoft for the command 'Get-NetIPAddress', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Gets the IP address configuration.

SYNTAX


Get-NetIPAddress [[-IPAddress] <String[]>] [-AddressFamily <AddressFamily[]>] [-AddressState <AddressState[]>] [-AsJob] [-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>]



Search powershellhelp.space

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
Format-List
Format-Table
Sort-Object
Where-Object
Get-NetRoute
New-NetIPAddress
Remove-NetIPAddress
Set-NetIPAddress

REMARKS

<

Examples


Example 1: Get IPv6 address configuration

PS C:\>Get-NetIPAddress –AddressFamily IPv6



This command gets information about IP address configuration for all IPv6 addresses on the computer.




Example 2: Get IP address information and format the output

PS C:\>Get-NetIPAddress | Format-Table



This command gets information about IP address configuration, and displays that information in a table. The table format provides a convenient overview for computers with
many IP addresses.




Example 3: Get IP address information by the interface index

PS C:\>Get-NetIPAddress –InterfaceIndex 12



This command gets information about IP address configuration for a specific interface index.




Example 4: Get IP address information and sort the output

PS C:\>Get-NetIPAddress | Sort-Object -Property InterfaceIndex | Format-Table



This command gets information about IP address configuration, sorts them numerically by the interface index in the cmdlet name, and then displays them in a table format.
This display can help you find IP address information by interface index.




Example 5: Get IP address information and filter the output

PS C:\>Get-NetIPAddress | Where-Object -FilterScript { $_.ValidLifetime -Lt ([TimeSpan]::FromDays(1)) }


Similarly, this cmdlet can be used to get information about IP address configuration for IP addresses that have an Infinite ValidLifetime.
PS C:\>Get-NetIPAddress | Where-Object -FilterScript { $_.ValidLifetime -Eq ([TimeSpan]::MaxValue) }



This command gets IP address configuration for IP addresses that have a ValidLifetime of less than one day.