Get-NetIPAddress

Get-NetIPAddress

Gets the IP address configuration.

구문

Parameter Set: Query (cdxml)
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>]

자세한 설명

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.

매개 변수

-AddressFamily<AddressFamily[]>

Specifies an array of IP address families. The cmdlet gets the IP address configuration that matches the address families. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- IPv4
-- IPv6

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-AddressState<AddressState[]>

Specifies an array of duplicate address detection (DAD) state values for the IP address. Use this parameter to filter the output based on addresses that are valid and available for use. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- Invalid. IP address configuration information for addresses that are not valid and will not be used.
-- Tentative. IP address configuration information for addresses that are not used for communication, as the uniqueness of those IP addresses is being verified.
-- Duplicate. IP address configuration information for addresses for which a duplicate IP address has been detected and the current IP address will not be used.
-- Deprecated. IP address configuration information for addresses that will no longer be used to establish new connections, but will continue to be used with existing connections.
-- Preferred. IP address configuration information for addresses that are valid and available for use.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-AsJob

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-AssociatedIPInterface<CimInstance>

Specifies an IP interface as a CIM object. To obtain an IP interface, use the Get-NetIPInterface cmdlet.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByValue)

와일드카드 문자 허용 여부

false

-CimSession<CimSession[]>

원격 세션에서 또는 원격 컴퓨터에서 cmdlet을 실행합니다. New-CimSession 또는 Get-CimSession cmdlet의 출력과 같은 컴퓨터 이름이나 세션 개체를 입력합니다. 기본값은 로컬 컴퓨터의 현재 세션입니다.

별칭

Session

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-IncludeAllCompartments

Indicates that the cmdlet includes addresses from all configured network compartments. If you do not specify this parameter, the cmdlet gets only addresses in the default network compartment.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-InterfaceAlias<String[]>

Specifies an array of aliases of network interfaces. The cmdlet gets IP addresses that match the aliases.

별칭

ifAlias

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-InterfaceIndex<UInt32[]>

Specifies an array of indexes of network interfaces. The cmdlet gets IP addresses that match the indexes.

별칭

ifIndex

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-IPAddress<String[]>

Specifies an array of IPv4 or IPv6 addresses.

별칭

LocalAddress

필수 여부

false

위치

1

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-PolicyStore<String>

Specifies a PolicyStore value. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- ActiveStore. The IP address information is valid.
-- PersistentStore. The computer saves IP address information across restarts. When the computer restarts, it copies the saved settings to the ActiveStore.

The default value is ActiveStore.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-PreferredLifetime<TimeSpan[]>

Specifies an array of values of preferred lifetimes, as TimeSpan objects, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-PrefixLength<Byte[]>

Specifies an array of prefix lengths. This parameter defines the local subnet size, and is also known as a subnet mask.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-PrefixOrigin<PrefixOrigin[]>

Specifies an array of origins for address prefixes. IP addresses are divided into two parts, the prefix and the suffix. The address prefix identifies the network portion of an IP address, and the address suffix identifies the host portion. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- Manual. The IP address prefix was manually specified.
-- WellKnown. The IP address prefix is from a well-known source.
-- DHCP. The IP address prefix was provided by DHCP settings.
-- RouterAdvertisement. The IP address prefix was obtained through a router advertisement (RA).

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-SkipAsSource<Boolean[]>

Indicates whether an address is a primary IP address. This parameter identifies the primary IP address for outgoing traffic in a multiple IP address scenario. If this parameter is set to True, the addresses are not used for outgoing traffic and are not registered in DNS.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-SuffixOrigin<SuffixOrigin[]>

Specifies an array of origins for address suffixes. IP addresses are divided into two parts, the prefix and the suffix. The address prefix identifies the network portion of an IP address, and the address suffix identifies the host portion. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- Manual. The IP address suffix was manually specified.
-- WellKnown. The IP address suffix is from a well-known source.
-- DHCP. The IP address suffix was provided by DHCP settings.
-- Link. The IP address suffix was obtained from the link-layer address.
-- Random. The IP address suffix was obtained from a random source.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-ThrottleLimit<Int32>

이 cmdlet을 실행하도록 설정할 수 있는 최대 동시 작업 수를 지정합니다. 이 매개 변수가 생략되거나 값 0이 입력되면 Windows PowerShell®은 컴퓨터에서 실행 중인 CIM cmdlet의 수에 따라 cmdlet에 대한 최적의 제한 한도를 계산합니다. 제한 한도는 현재 cmdlet에만 적용되며 세션이나 컴퓨터에는 적용되지 않습니다.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Type<Type[]>

Specifies an array of IP address types. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- Unicast
-- Anycast

The default value is Unicast.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-ValidLifetime<TimeSpan[]>

Specifies an array of values for valid lifetimes, as TimeSpan objects, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • None

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

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

    Microsoft.Management.Infrastructure.CimInstance 개체는 WMI(Windows Management Instrumentation) 개체를 표시하는 래퍼 클래스입니다. 파운드 기호(#) 뒤에 오는 경로는 기본 WMI 개체의 네임스페이스 및 클래스 이름을 제공합니다.

예제

Example 1: Get IPv6 address configuration

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

PS C:\> Get-NetIPAddress –AddressFamily IPv6

Example 2: Get IP address information and format the output

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.

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

Example 3: Get IP address information by the interface index

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

PS C:\> Get-NetIPAddress –InterfaceIndex 12

Example 4: Get IP address information and sort the output

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.

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

Example 5: Get IP address information and filter the output

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

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) }

관련 항목

Get-NetRoute

New-NetIPAddress

Remove-NetIPAddress

Set-NetIPAddress

Format-List

Format-Table

Sort-Object

Where-Object