Edit

Share via


Get-NetIPConfiguration

Gets IP network configuration.

Syntax

Alias (Default)

Get-NetIPConfiguration
    [[-InterfaceAlias] <String>]
    [-AllCompartments]
    [-CompartmentId <Int32>]
    [-Detailed]
    [-CimSession <CimSession>]
    [<CommonParameters>]

Index

Get-NetIPConfiguration
    -InterfaceIndex <Int32>
    [-AllCompartments]
    [-CompartmentId <Int32>]
    [-Detailed]
    [-CimSession <CimSession>]
    [<CommonParameters>]

All

Get-NetIPConfiguration
    [-All]
    [-AllCompartments]
    [-CompartmentId <Int32>]
    [-Detailed]
    [-CimSession <CimSession>]
    [<CommonParameters>]

Description

The Get-NetIPConfiguration cmdlet gets network configuration, including usable interfaces, IP addresses, and DNS servers.

If you do not specify any parameters, this cmdlet gets IP configuration properties for all non-virtual connected interfaces on a computer.

Examples

Example 1: Get the IP configuration

PS C:\>Get-NetIPConfiguration

This command gets IP configuration information. When this cmdlet is run without parameters, it gets the IP configuration information for all of the non-virtual connected interfaces on the computer.

Example 2: Get all IP configuration details

PS C:\>Get-NetIPConfiguration -All

This command gets the IP configuration information for all of the interfaces on the computer, including virtual interfaces, loopback interfaces, and disconnected interfaces.

Example 3: Get the IP configuration information with a common parameter

PS C:\>Get-NetIPConfiguration -Verbose

This command gets IP configuration information. By using the Verbose parameter, the networking cmdlets are shown to gather and format the information displayed in this cmdlet.

Example 4: Get the IP configuration by interface index

PS C:\>Get-NetIPConfiguration -InterfaceIndex 12

This command gets the IP configuration information for the interface at the index 12.

Example 5: Get the IP configuration from pipeline input

PS C:\>Get-NetIPConfiguration | Get-NetIPAddress

This command gets the IP address information, including the prefix length.

Parameters

-All

Indicates that the cmdlet retrieves the IP configuration properties for all of the interfaces on a computer, including virtual interfaces, loopback interfaces, and disconnected interfaces.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IncludeAllInterfaces

Parameter sets

All
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AllCompartments

Indicates that the cmdlet gets the IP configuration properties for all of the compartments on a computer.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IncludeAllCompartments

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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.

Parameter properties

Type:CimSession
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PSComputerName, ComputerName

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-CompartmentId

Specifies an identifier for network compartment in the protocol stack. By default, the cmdlet gets Net IP configuration in the default compartment. If you specify a value for this parameter, the cmdlet gets any matching Net IP configuration in the compartment specified in this field.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Detailed

Indicates that the cmdlet retrieves additional interface and computer configuration information, including the computer name, link layer address, network profile, MTU length, and DHCP status.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InterfaceAlias

Specifies an alias of a network interface. The cmdlet gets an IP configuration that matches the alias.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False
Aliases:ifAlias

Parameter sets

Alias
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-InterfaceIndex

Specifies an index of a network interface. The cmdlet gets an IP configuration that matches the index.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ifIndex

Parameter sets

Index
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

None