Editar

Compartilhar via


Get-NetIPConfiguration

Gets IP network configuration.

Syntax

Get-NetIPConfiguration
   [[-InterfaceAlias] <String>]
   [-AllCompartments]
   [-CompartmentId <Int32>]
   [-Detailed]
   [-CimSession <CimSession>]
   [<CommonParameters>]
Get-NetIPConfiguration
   -InterfaceIndex <Int32>
   [-AllCompartments]
   [-CompartmentId <Int32>]
   [-Detailed]
   [-CimSession <CimSession>]
   [<CommonParameters>]
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.

Type:SwitchParameter
Aliases:IncludeAllInterfaces
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AllCompartments

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

Type:SwitchParameter
Aliases:IncludeAllCompartments
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:CimSession
Aliases:PSComputerName, ComputerName
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters: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.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters: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.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InterfaceAlias

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

Type:String
Aliases:ifAlias
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

-InterfaceIndex

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

Type:Int32
Aliases:ifIndex
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

None

Outputs

None