PowerShell Logo Small

Get-NetIPAddress



This is the built-in help made by Microsoft for the command 'Get-NetIPAddress', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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 information about IP address configuration.

SYNTAX


Get-NetIPAddress [[-IPAddress] <String[]>] [-AddressFamily <AddressFamily[]>] [-AddressState <AddressState[]>] [-AsJob [<SwitchParameter>]]
[-AssociatedIPInterface <CimInstance>] [-CimSession <CimSession[]>] [-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 information such as IPv4 addresses, IPv6 addresses and the IP interfaces with which addresses
are associated.

This cmdlet also gets the PrefixLength, also known as a subnet mask. For more information on subnetting, see Subnetting on TechNet
(http://technet.microsoft.com/library/bb726997.aspx) on TechNet.

This cmdlet does not get the gateway as that is a routing concept covered by the Get-NetRoute cmdlet. For IP endpoints, the gateway specifies
the forwarding address or the next hop IP address over which the set of addresses defined by the network destination and subnet mask are
reachable.

Without parameters, this cmdlet gets all of the IP address configuration information on the computer.



<

RELATED LINKS

Format-List
Format-Table
Sort-Object
Where-Object
Get-NetRoute
New-NetIPAddress
Remove-NetIPAddress
Set-NetIPAddress

REMARKS

<

Examples


EXAMPLE 1

PS C:\>Get-NetIPAddress –AddressFamily IPv6



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




EXAMPLE 2

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



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




EXAMPLE 3

PS C:\>Get-NetIPAddress –InterfaceIndex 12



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




EXAMPLE 4

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



This example 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

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 example gets information about IP address configuration for IP addresses that have a ValidLifetime of less than one day.