Set-NetIPAddress

Set-NetIPAddress

Modifies the configuration of an IP address.

구문

Parameter Set: Query (cdxml)
Set-NetIPAddress [[-IPAddress] <String[]> ] [-AddressFamily <AddressFamily[]> ] [-AddressState <AddressState[]> ] [-CimSession <CimSession[]> ] [-IncludeAllCompartments] [-InterfaceAlias <String[]> ] [-InterfaceIndex <UInt32[]> ] [-PassThru] [-PolicyStore <String> ] [-PreferredLifetime <TimeSpan> ] [-PrefixLength <Byte> ] [-PrefixOrigin <PrefixOrigin[]> ] [-SkipAsSource <Boolean> ] [-SuffixOrigin <SuffixOrigin[]> ] [-ThrottleLimit <Int32> ] [-Type <Type[]> ] [-ValidLifetime <TimeSpan> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: InputObject (cdxml)
Set-NetIPAddress [-CimSession <CimSession[]> ] [-PassThru] [-PreferredLifetime <TimeSpan> ] [-PrefixLength <Byte> ] [-SkipAsSource <Boolean> ] [-ThrottleLimit <Int32> ] [-ValidLifetime <TimeSpan> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]

자세한 설명

The Set-NetIPAddress cmdlet modifies IP address configuration properties of an existing IP address.

To create an IPv4 address or IPv6 address, use the New-NetIPAddress cmdlet.

매개 변수

-AddressFamily<AddressFamily[]>

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

-- IPv4
-- IPv6

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-AddressState<AddressState[]>

Specifies an array of duplicate address detection (DAD) state values for the IP address. 이 매개 변수에 허용되는 값은 다음과 같습니다.

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

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-CimSession<CimSession[]>

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

별칭

Session

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-IncludeAllCompartments

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

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-InterfaceAlias<String[]>

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

별칭

ifAlias

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-InterfaceIndex<UInt32[]>

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

별칭

ifIndex

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-IPAddress<String[]>

Specifies an array of IPv4 or IPv6 addresses.

별칭

LocalAddress

필수 여부

false

위치

1

기본값

none

파이프라인 입력 허용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-PassThru

작업 중인 항목을 나타내는 개체를 반환합니다. 기본적으로 이 cmdlet은 출력을 생성하지 않습니다.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

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. Specify ActiveStore only.

If you do not specify this parameter, the default entries are created in both the ActiveStore and the PersistentStore.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-PreferredLifetime<TimeSpan>

Specifies a preferred lifetime, as a TimeSpan object, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-PrefixLength<Byte>

Specifies a prefix length. This parameter defines the local subnet size, and is also known as a subnet mask.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-PrefixOrigin<PrefixOrigin[]>

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

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 address is not used for outgoing traffic and is not registered in DNS.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

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.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-ThrottleLimit<Int32>

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

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Type<Type[]>

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

-- Unicast
-- Anycast

The default value is Unicast.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-ValidLifetime<TimeSpan>

Specifies a valid lifetime, as a TimeSpan object, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지를 표시합니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행되는 경우 발생할 결과를 보여 줍니다. cmdlet은 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable 등의 일반 매개 변수를 지원합니다. 자세한 내용은 TechNet의 about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216)

<WorkflowParameters>

입력

입력 형식은 cmdlet으로 파이프할 수 있는 개체의 형식입니다.

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

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

출력

출력 형식은 cmdlet 실행 시 출력되는 개체의 형식입니다.

  • None

Example 1: Modify an IP address

This command adds the IP address 192.168.0.1 to the interface located at index 12.

The PrefixLength parameter may also be specified as part of the Set-NetIPAddress cmdlet.

PS C:\> Set-NetIPAddress –InterfaceIndex 12 –IPAddress 192.168.0.1
PS C:\> Set-NetIPAddress –InterfaceIndex 12 –IPAddress 192.168.0.1 –PrefixLength 24

Example 2: Modify an IP address and set the valid lifetime

The first command creates a new TimeSpan object of one day, and stores it in the variable named $Timesp.

The second command then uses the TimeSpan object to set the preferred lifetime of the IP address located at interface 12 to one day.

PS C:\> $Timesp = ( New-TimeSpan –Days 1 )
PS C:\> Set-NetIPAddress –InterfaceIndex 12 –IPAddress 192.168.0.1 –PreferredLifetime $Timesp

관련 항목

Get-NetIPAddress

New-NetIPAddress

Remove-NetIPAddress

New-TimeSpan