Export (0) Print
Expand All

Get-NetIPInterface

Applies To: Windows Server 2012

Get-NetIPInterface

Gets information about the IP interface properties.

Syntax

Parameter Set: ByName
Get-NetIPInterface [[-InterfaceAlias] <String[]> ] [-AddressFamily <AddressFamily[]> ] [-AdvertiseDefaultRoute <AdvertiseDefaultRoute[]> ] [-AdvertisedRouterLifetime <TimeSpan[]> ] [-Advertising <Advertising[]> ] [-AsJob] [-AutomaticMetric <AutomaticMetric[]> ] [-BaseReachableTimeMs <UInt32[]> ] [-CimSession <CimSession[]> ] [-ConnectionState <ConnectionState[]> ] [-CurrentHopLimit <UInt32[]> ] [-DadTransmits <UInt32[]> ] [-Dhcp <Dhcp[]> ] [-DirectedMacWolPattern <DirectedMacWolPattern[]> ] [-EcnMarking <EcnMarking[]> ] [-ForceArpNdWolPattern <ForceArpNdWolPattern[]> ] [-Forwarding <Forwarding[]> ] [-IgnoreDefaultRoutes <IgnoreDefaultRoutes[]> ] [-InterfaceIndex <UInt32[]> ] [-InterfaceMetric <UInt32[]> ] [-ManagedAddressConfiguration <ManagedAddressConfiguration[]> ] [-NeighborDiscoverySupported <NeighborDiscoverySupported[]> ] [-NeighborUnreachabilityDetection <NeighborUnreachabilityDetection[]> ] [-NlMtuBytes <UInt32[]> ] [-OtherStatefulConfiguration <OtherStatefulConfiguration[]> ] [-PolicyStore <String> ] [-ReachableTimeMs <UInt32[]> ] [-RetransmitTimeMs <UInt32[]> ] [-RouterDiscovery <RouterDiscovery[]> ] [-ThrottleLimit <Int32> ] [-WeakHostReceive <WeakHostReceive[]> ] [-WeakHostSend <WeakHostSend[]> ] [ <CommonParameters>]

Parameter Set: ByAdapter
Get-NetIPInterface [-AsJob] [-AssociatedAdapter <CimInstance> ] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

Parameter Set: ByIPAddress
Get-NetIPInterface [-AsJob] [-AssociatedIPAddress <CimInstance> ] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

Parameter Set: ByNeighbor
Get-NetIPInterface [-AsJob] [-AssociatedNeighbor <CimInstance> ] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

Parameter Set: ByRoute
Get-NetIPInterface [-AsJob] [-AssociatedRoute <CimInstance> ] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]




Detailed Description

The Get-NetIPInterface cmdlet gets IP interface properties such as IPv4 addresses, IPv6 addresses and the IP interfaces to which these addresses are associated. Interface properties include properties such as DHCP is enabled or disabled, Wake on LAN (WoL) settings and IPv6 address auto-configuration settings. More information on IPv6 is available here IPv6 Address Autoconfiguration 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 or 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 interface properties on the computer, including virtual interfaces and loopback interfaces.

Parameters

-AddressFamily<AddressFamily[]>

Gets IP interface properties only about interfaces that have IP addresses of a specific IP address family. The acceptable values for this parameter are: 
-- IPv4: IP Interface properties for interfaces with IPv4 addresses.
-- IPv6: IP Interface properties for interfaces with IPv6 addresses.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AdvertiseDefaultRoute<AdvertiseDefaultRoute[]>

Gets IP interface properties only for interfaces by AdvertiseDefaultRoute. This parameter indicates whether the IP interface should advertise itself as a default router regardless of whether the node has a default route itself. Valid only for advertising interfaces. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces with the AdvertiseDefaultRoute set to Enabled.
-- Disabled: IP Interface properties for interfaces with the AdvertiseDefaultRoute set to Disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AdvertisedRouterLifetime<TimeSpan[]>

Gets IP interface properties only for interfaces by AdvertisedRouterLifetime. This parameter indicates the lifetime of default routes when advertising routes on the IP interface, in seconds. The default value is 1800. Valid only for advertising interfaces. This parameter uses time as defined by the TimeSpan structure.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Advertising<Advertising[]>

Gets IP interface properties only for interfaces by if they send or do not send Router Advertisements. The default value is Disabled. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that are enabled to send Router Advertisements.
-- Disabled: IP Interface properties for interfaces that have Router Advertisements disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet. For more information about Windows PowerShell® background jobs, see about_Jobs.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AssociatedAdapter<CimInstance>

Gets IP interface properties only about a specific network adapter CIM object. This is typically as input through the pipeline.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-AssociatedIPAddress<CimInstance>

Gets IP interface properties only about a specific network IP address CIM object. This is typically as input through the pipeline.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-AssociatedNeighbor<CimInstance>

Gets IP interface properties only about a specific network neighbor CIM object. This is typically as input through the pipeline.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-AssociatedRoute<CimInstance>

Gets IP interface properties only about a specific network route CIM object. This is typically as input through the pipeline.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-AutomaticMetric<AutomaticMetric[]>

Gets IP interface properties only for interfaces by the AutomaticMetric property. This parameter determines whether TCP/IP automatically calculates a value for an interface metric that is based on the speed of the interface. The highest-speed interface has the lowest interface metric value. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces with the AutomaticMetric set to Enabled.
-- Disabled: IP Interface properties for interfaces with the AutomaticMetric set to Disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BaseReachableTimeMs<UInt32[]>

Gets IP interface properties only for interfaces by the BaseReachableTime property. This parameter is the base for random reachable time, in milliseconds. This parameter is described in RFC 2461. The default BaseReachableTime setting is 30.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ConnectionState<ConnectionState[]>

Gets IP interface properties only for interfaces that are physically connected to a network.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CurrentHopLimit<UInt32[]>

Gets IP interface properties only for interfaces that have a specific CurrentHopLimit. This parameter is the value that the IP interface writes in the hop limit (for IPv6) or TTL (for IPv4) field in all outbound traffic. When forwarding a packet, routers are required to decrease the Hop Limit or TTL by 1 and to discard the packet when the Hop Limit or TTL is 0. The default is defined as DefaultHopLimit in the NetIPv4Protocol and NetIPv6Protocol objects. When CurrentHopLimit is set to 0, it uses this default.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DadTransmits<UInt32[]>

Gets IP interface properties only for interfaces that have a specific DadTransmits property. This parameter is the number of duplicate address detection transmits.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Dhcp<Dhcp[]>

Gets the enabled state for the IP interface of the Dynamic Host Configuration Protocol (DHCP).
Note: This setting is persistent across reboots and only stored in the active policy store.
The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have DHCP enabled.
-- Disabled: IP Interface properties for interfaces that have DHCP disabled.
The default value is Enabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DirectedMacWolPattern<DirectedMacWolPattern[]>

Gets IP interface properties only for interfaces by if they have DirecteMacWolPattern enabled or disabled. DirecteMacWolPattern determines if an IP interface is configured to wake up a computer with directed MAC packet patterns. By default, IP interface properties have DirecteMacWolPattern set to disabled. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have DirecteMacWolPattern enabled.
-- Disabled: IP Interface properties for interfaces that have DirecteMacWolPattern disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EcnMarking<EcnMarking[]>

Gets one or more IP interface properties only for interfaces with a specific ECN marking value. This parameter value controls the specific ECN marking in the ECN field of the IP header. The acceptable values for this parameter are: 
-- AppDecide: Allow an application or higher layer such as TCP to decide how to apply ECN marking. In order for an application to fully control ECN capability value in the Network TCP setting must also be set to Enabled.
-- Disabled: Disable the ECN marking on the IP interface.
-- UseEct0: Mark all of the egress IP packets on the IP interface with the Ect0 bit set.
-- UseEct1: Mark all of the egress IP packets on the IP interface with the Ect1 bit set.
The default value is AppDecide.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ForceArpNdWolPattern<ForceArpNdWolPattern[]>

Gets IP interface properties only for interfaces by if they have ForceArpNdWolPattern enabled or disabled. This parameter determines if an IP interface is configured to wake up a computer with Address Resolution Protocol (ARP) and Neighbor Discovery (ND) packet patterns. By default, IP interface properties have ForceArpNdWolPattern set to disabled. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have ForceArpNdWolPattern enabled.
-- Disabled: IP Interface properties for interfaces that have ForceArpNdWolPattern disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Forwarding<Forwarding[]>

Gets IP interface properties only about a specific interface, as defined by Forwarding. Forwarding determines whether packets arriving on this IP interface can be forwarded to other interfaces. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have Forwarding enabled.
-- Disabled: IP Interface properties for interfaces that have Forwarding disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IgnoreDefaultRoutes<IgnoreDefaultRoutes[]>

Gets IP interface properties only about a specific interface, as defined by IgnoreDefaultRoutes. If enabled, then IgnoreDefaultRoutes ensures that default routes will not be dynamically added to the routing table. By default, interface properties have IgnoreDefaultRoutes set to disabled. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have IgnoreDefaultRoutes enabled.
-- Disabled: IP Interface properties for interfaces that have IgnoreDefaultRoutes disabled.


Aliases

none

Required?

false

Position?

named

Default Value

Disabled

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InterfaceAlias<String[]>

Gets IP interface properties only about a specific interface, as defined by the InterfaceAlias.


Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-InterfaceIndex<UInt32[]>

Gets IP interface properties only about a specific interface, as defined by the InterfaceIndex number.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-InterfaceMetric<UInt32[]>

Gets IP interface properties only about a specific interface, as defined by the InterfaceMetric. When routes are chosen, the overall metric used to determine the preference is the sum of the route metric and the interface metric. Typically, the interface metric gives preference to a particular interface, such as using wired if both wired and wireless are available. The default value is automatic.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ManagedAddressConfiguration<ManagedAddressConfiguration[]>

Gets IP interface properties only for interfaces by the ManagedAddressConfiguration property. This parameter determines if an IP interface uses a stateful protocol (such as DHCP) to obtain an address. Setting this parameter will have no effect on an interface that has router discovery enabled and advertising disabled. In that case the parameter is controlled by router discovery. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have ManagedAddressConfiguration enabled.
-- Disabled: IP Interface properties for interfaces that have ManagedAddressConfiguration disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NeighborDiscoverySupported<NeighborDiscoverySupported[]>

Gets IP interface properties only for interfaces by the NeighborDiscoverySupported property. This parameter specifies if the IP interface supports neighbor discovery. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have NeighborDiscoverySupported enabled.
-- Disabled: IP Interface properties for interfaces that have NeighborDiscoverySupported disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NeighborUnreachabilityDetection<NeighborUnreachabilityDetection[]>

Gets IP interface properties only for interfaces by the NeighborUnreachablilityDetection property. This parameter is how nodes determine that a neighbor is no longer reachable. Default depends on type of interface. This parameter is described in RFC 2461. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have NeighborUnreachabilityDetection enabled.
-- Disabled: IP Interface properties for interfaces that have NeighborUnreachabilityDetection disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NlMtuBytes<UInt32[]>

Gets IP interface properties only about a specific interface, as defined by the Network Layer MTU (NlMtu) property. NlMtu is the network layer Maximum Transmission Unit, in bytes. The IP interface will not transmit packets larger than NlMtuBytes.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OtherStatefulConfiguration<OtherStatefulConfiguration[]>

Gets IP interface properties only for interfaces by if they have a specific OtherStateful setting. OtherStateful determines if an IP interface uses a stateful protocol (such as DHCP) to obtain configuration information other than addresses. Setting this parameter will have no effect on an interface that has router discovery enabled and advertising disabled. In that case the parameter is controlled by router discovery. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have OtherStatefulConfiguration enabled.
-- Disabled: IP Interface properties for interfaces that have OtherStatefulConfiguration disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PolicyStore<String>

Specifies the PolicyStore value. The acceptable values for this parameter are: 
-- ActiveStore: The IP address information is currently valid.
-- PersistentStore: The IP address information is persistent across reboots. When the computer starts, the PersistentStore settings are copied to the ActiveStore.
The default value is ActiveStore.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ReachableTimeMs<UInt32[]>

Gets IP interface properties only about a specific interface, as defined by the BaseReachableTime. This parameter is the time, in milliseconds, that a node assumes that a neighbor is reachable after having received a reachability confirmation. Used by Neighbor Unreachability Detection.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RetransmitTimeMs<UInt32[]>

Gets IP interface properties only about a specific interface, as defined by the RetransmitTime. This parameter defines the timeout and retransmission of Neighbor Solicitation messages, in milliseconds. This parameter is described as RetransTimer in RFC 2461. The default value is 1000.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RouterDiscovery<RouterDiscovery[]>

Gets IP interface properties only for interfaces by if they have a specific RouterDiscovery setting. By default, interface properties have RouterDiscovery ControlledByDHCP for IPv4 and enabled for IPv6. If RouterDiscovery is enabled, then an IP host can locate routers that reside on an attached link. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have RouterDiscovery enabled.
-- Disabled: IP Interface properties for interfaces that have RouterDiscovery disabled.
-- ControlledByDHCP: IP Interface properties for interfaces that have RouterDiscovery controlled by Dynamic Host Configuration Protocol (DHCP).


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WeakHostReceive<WeakHostReceive[]>

Gets IP interface properties only for interfaces by if they have WeakHostReceive enabled or disabled. By default, interface properties have WeakHostReceive set to disabled. If WeakHostReceive is enabled, then an IP host can receive IP packets on an interface that is not assigned the destination IP address of the packet being received. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have WeakHostReceive enabled.
-- Disabled: IP Interface properties for interfaces that have WeakHostReceive disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WeakHostSend<WeakHostSend[]>

Gets IP interface properties only for interfaces by if they have WeakHostSend enabled or disabled. By default, interface properties have WeakHostSend set to disabled. If WeakHostSend is enabled, then an IP host can send IP packets on an interface that is not assigned the destination IP address of the packet being sent. The acceptable values for this parameter are: 
-- Enabled: IP Interface properties for interfaces that have WeakHostSend enabled.
-- Disabled: IP Interface properties for interfaces that have WeakHostSend disabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Management.Infrastructure.CimInstance#root\StandardCimv2\MSFT_NetIPInterface

    The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#) provides the namespace and class name for the underlying WMI object.


Examples

EXAMPLE 1

This example gets information about IP interface configuration.


 

Used without parameters gets IP interface information for the computer.


PS C:\> Get-NetIPInterface

 

The default output omits some properties. Use this cmdlet to display all fields (all properties of the object).


PS C:\> Get-NetIPAddress | Format-List –Property *

EXAMPLE 2

This example gets information about IP interface configuration for all IP interfaces that have IPv6 addresses configured.


PS C:\> Get-NetIPInterface –AddressFamily IPv6

EXAMPLE 3

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


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

EXAMPLE 4

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


PS C:\> Get-NetIPInterface –InterfaceIndex 12

EXAMPLE 5

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.


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

EXAMPLE 6

This example gets information about IP address configuration for all IP interfaces that have a default AdvertisedRouterLifetime.


PS C:\> Get-NetIPInterface | Where-Object -FilterScript { $_.AdvertisedRouterLifetime.TotalSeconds -Eq 1800 }

Related topics

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft