Set-NetNeighbor
Set-NetNeighbor
Modifies a neighbor cache entry.
構文
Parameter Set: ByName
Set-NetNeighbor [[-IPAddress] <String[]> ] [-AddressFamily <AddressFamily[]> ] [-CimSession <CimSession[]> ] [-IncludeAllCompartments] [-InterfaceAlias <String[]> ] [-InterfaceIndex <UInt32[]> ] [-LinkLayerAddress <String> ] [-PassThru] [-PolicyStore <String> ] [-State <State[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]
Parameter Set: InputObject (cdxml)
Set-NetNeighbor [-CimSession <CimSession[]> ] [-LinkLayerAddress <String> ] [-PassThru] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]
詳細説明
The Set-NetNeighbor cmdlet modifies a neighbor cache entry. The neighbor cache maintains information for each on-link neighbor, including the IP address and the associated link-layer address. You can modify only neighbor cache entries that are in a permanent state on interfaces that have link-layer addresses. Use this cmdlet to modify the link-layer address and policy store setting of a neighbor cache entry.
パラメーター
-AddressFamily<AddressFamily[]>
Specifies an array of IP address families. The cmdlet modifies the neighbor cache entries that belong to the IP address families you specify. If you do not specify this parameter, the cmdlet automatically generates the address families of the neighbor cache entries. このパラメーターに指定できる値は、次のとおりです。
-- IPv4
-- IPv6
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-CimSession<CimSession[]>
リモート セッションまたはリモート コンピューターでコマンドレットを実行します。コンピューター名またはセッション オブジェクト (New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など) を入力します。既定値は、ローカル コンピューター上の現在のセッションです。
Aliases |
Session |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-IncludeAllCompartments
Indicates that the cmdlet includes neighbor cache entries from all configured network compartments. If you do not specify this parameter, the cmdlet modifies only neighbor cache entries in the default network compartment.
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-IPAddress<String[]>
Specifies an array of IP addresses. The cmdlet modifies neighbor cache entries that have the IP addresses you specify.
Aliases |
none |
必須/オプション |
false |
位置 |
1 |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-LinkLayerAddress<String>
Specifies the link-layer address of the neighbor cache entry. The cmdlet modifies the link-layer address of the neighbor cache entry you specify.
The link-layer address is also called the media access control (MAC) address. A link-layer address that uses IPv4 address syntax is a tunnel technology that encapsulates packets over an IPv4 tunnel, such as Intra-Site Automatic Tunnel Addressing Protocol (ISATAP) or Teredo. A link-layer address of all zeroes indicates that the neighbor is unreachable and the neighbor cache entry does not have a link-layer address entry. An empty link-layer address indicates that the link layer does not use link-layer addresses, such as on a loopback interface.
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-InterfaceAlias<String[]>
Specifies an array of aliases of network interfaces. The cmdlet modifies neighbor cache entries for the network interfaces that have the aliases you specify.
Aliases |
ifAlias |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-InterfaceIndex<UInt32[]>
Specifies an array of indexes of network interfaces. The cmdlet modifies neighbor cache entries for the network interfaces located at the indexes you specify.
Aliases |
ifIndex |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-PassThru
作業中の項目を表すオブジェクトを返します。既定では、このコマンドレットから出力は生成されません。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-PolicyStore<String>
Specifies a PolicyStore value. The cmdlet modifies the PolicyStore setting for the neighbor cache entry to the value you specify. このパラメーターに指定できる値は、次のとおりです。
-- 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.
Specify ActiveStore only.
If you do not specify this parameter, the default entries are created in both the ActiveStore and the PersistentStore.
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-State<State[]>
Specifies an array of states of the neighbor cache entry. The cmdlet modifies the neighbor cache entries that have the states you specify. You can modify only neighbor cache entries that are in a permanent state. このパラメーターに指定できる値は、次のとおりです。
-- Permanent. The neighbor is statically provisioned and will not expire unless you remove it.
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-ThrottleLimit<Int32>
コマンドレットを実行する際に確立できる同時実行操作の最大数を指定します。このパラメーターを省略するか、値 0
を入力した場合、コンピューター上で実行されている CIM コマンドレットの数に基づいて、コマンドレットに最適なスロットル制限が Windows PowerShell® によって計算されます。スロットル制限は、セッションやコンピューターではなく、現在のコマンドレットにのみ適用されます。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-Confirm
コマンドレットを実行する前に確認メッセージを表示します。
必須/オプション |
false |
位置 |
named |
既定値 |
false |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-WhatIf
コマンドレットが実行された場合に何が起きるのかを示します。コマンドレットは実行されません。
必須/オプション |
false |
位置 |
named |
既定値 |
false |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
<CommonParameters>
このコマンドレットは共通のパラメーターをサポートしています(-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、および -OutVariable)。詳細については、TechNet の「 「about_CommonParameters」 (https://go.microsoft.com/fwlink/p/?LinkID=113216) を参照してください。
<WorkflowParameters>
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
Microsoft.Management.Infrastructure.CimInstance#root\StandardCimv2\MSFT_NetNeighbor
Microsoft.Management.Infrastructure.CimInstance
オブジェクトは、Windows Management Instrumentation (WMI) オブジェクトを表示するラッパー クラスです。基になる WMI オブジェクトの名前空間とクラス名は、シャープ記号 (#
) に続くパスで指定されます。
出力
出力型は、コマンドレットが出力するオブジェクトの型です。
- None
使用例
Example 1: Set the link-layer address for a neighbor cache entry
This command sets the link-layer address for the neighbor cache entry that has the IP address 192.168.0.5 and the interface index value of 12.
PS C:\> Set-NetNeighbor –InterfaceIndex 12 –IPAddress "192.168.0.5" –LinkLayerAddress "00-00-12-00-00-ff"
Example 2: Set the link-layer address for a neighbor cache entry by using an input object
This command gets the NetNeighbor object that has the IP address 192.168.0.5 and the interface index value of 12. The command passes the object to the Set-NetNeighbor cmdlet by using the pipeline operator. Set-NetNeighbor sets the link-layer address for the neighbor cache entry to 00-00-12-00-00-ff.
PS C:\> Get-NetNeighbor –InterfaceIndex 12 –IPAddress "192.168.0.5" | Set-NetNeighbor –LinkLayerAddress "00-00-12-00-00-ff"