Remove-NetIPAddress
Remove-NetIPAddress
Removes an IP address and its configuration.
Syntax
Parameter Set: Query (cdxml)
Remove-NetIPAddress [[-IPAddress] <String[]> ] [-AddressFamily <AddressFamily[]> ] [-AddressState <AddressState[]> ] [-CimSession <CimSession[]> ] [-DefaultGateway <String> ] [-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)
Remove-NetIPAddress [-CimSession <CimSession[]> ] [-PassThru] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]
Detaillierte Beschreibung
The Remove-NetIPAddress cmdlet removes an IP address and its configuration. To remove a specific IP address object, use the IPv4 Address parameter or IPv6 Address parameter. If you do not specify an IPv4 or IPv6 address, the cmdlet will remove all IP addresses that match.
Parameter
-AddressFamily<AddressFamily[]>
Specifies an array of IP address families. The cmdlet removes the IP address that matches the families. Die zulässigen Werte für diesen Parameter sind:
-- IPv4
-- IPv6
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-AddressState<AddressState[]>
Specifies an array of duplicate address detection (DAD) state values for the IP address. Die zulässigen Werte für diesen Parameter sind:
-- 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.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-CimSession<CimSession[]>
Das Cmdlet wird in einer Remotesitzung oder auf einem Remotecomputer ausgeführt. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, wie z. B. die Ausgabe eines New-CimSession oder Get-CimSession-Cmdlets. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.
Aliase |
Session |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-DefaultGateway<String>
Specifies the IPv4 address or IPv6 address of the default gateway for the host. Default gateways provide a default route for TCP/IP hosts to use when communicating with other hosts on remote networks.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-IncludeAllCompartments
Indicates that the cmdlet includes addresses from all configured network compartments. If you do not specify this parameter, the cmdlet removes only addresses in the default network compartment.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-InterfaceAlias<String[]>
Specifies an array of aliases of network interfaces. The cmdlet removes IP addresses that match the aliases.
Aliase |
ifAlias |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
True (ByPropertyName) |
Platzhalterzeichen akzeptieren? |
false |
-InterfaceIndex<UInt32[]>
Specifies an array of indexes of network interfaces. The cmdlet removes IP addresses that match the indexes.
Aliase |
ifIndex |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
True (ByPropertyName) |
Platzhalterzeichen akzeptieren? |
false |
-IPAddress<String[]>
Specifies an array of IPv4 or IPv6 addresses.
Aliase |
LocalAddress |
Erforderlich? |
false |
Position? |
1 |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
True (ByPropertyName) |
Platzhalterzeichen akzeptieren? |
false |
-PassThru
Gibt ein Objekt an, das das Element darstellt, mit dem Sie arbeiten. Dieses Cmdlet generiert standardmäßig keine Ausgabe.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-PolicyStore<String>
Specifies a PolicyStore value. Die zulässigen Werte für diesen Parameter sind:
-- 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.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
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.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-PrefixLength<Byte[]>
Specifies an array of prefix lengths. This parameter defines the local subnet size, and is also known as a subnet mask.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-PrefixOrigin<PrefixOrigin[]>
Specifies an array of origins of 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. Die zulässigen Werte für diesen Parameter sind:
-- 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).
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
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.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-SuffixOrigin<SuffixOrigin[]>
Specifies an array of origins of 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. Die zulässigen Werte für diesen Parameter sind:
-- Manual. The IP address prefix 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.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-ThrottleLimit<Int32>
Gibt die maximale Anzahl gleichzeitiger Vorgänge an, die zum Ausführen des Cmdlets hergestellt werden können. Wenn dieser Parameter ausgelassen wird oder der Wert 0
eingegeben wird, berechnet Windows PowerShell ® einen optimalen Drosselungsgrenzwert für das Cmdlet basierend auf der Anzahl der CIM-Cmdlets, die auf dem Computer ausgeführt werden. Der Grenzwert gilt nur für das aktuelle Cmdlet, nicht für die Sitzung oder den Computer.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Type<Type[]>
Specifies an array of IP address types. Die zulässigen Werte für diesen Parameter sind:
-- Unicast
-- Anycast
The default value is Unicast.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-ValidLifetime<TimeSpan[]>
Specifies an array of values of valid lifetimes, as TimeSpan objects, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Confirm
Fordert Sie vor der Ausführung des Cmdlet zum Bestätigen auf.
Erforderlich? |
false |
Position? |
named |
Standardwert |
false |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-WhatIf
Zeit, was passieren würde, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.
Erforderlich? |
false |
Position? |
named |
Standardwert |
false |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
<CommonParameters>
Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
<WorkflowParameters>
Eingaben
Der Eingabetyp ist der Typ der Objekte, die Sie per Piping an das Cmdlet übergeben können.
Microsoft.Management.Infrastructure.CimInstance#root\StandardCimv2\MSFT_NetIPAddress
Das
Microsoft.Management.Infrastructure.CimInstance
-Objekt ist eine Wrapperklasse, die Windows-Verwaltungsinstrumentation-Objekte (Windows Management Instrumentation, WMI) angezeigt. Der Pfad nach dem Nummernzeichen (#
) stellt den Namespace und den Klassennamen des zugrunde liegenden WMI-Objekts dar.
Ausgaben
Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.
- None
Beispiele
Example 1: Remove an IP address
This command adds a new IP address.
PS C:\> New-NetIPAddress –InterfaceIndex 12 –IPAddress 192.168.0.1
This command removes the IP address created by the previous command.
PS C:\> Remove-NetIPAddress –IPAddress 192.168.0.1
Example 2: Remove an IP address using a pipeline
This command removes all of the IP addresses with the address 192.168.0.1.
PS C:\> Get-NetIPAddress –IPAddress 192.168.0.1 | Remove-NetIPAddress
Example 3: Remove IP addresses by prefix origin
This command removes all of the IP addresses that have a manually-configured prefix origin.
PS C:\> Remove-NetIPAddress –PrefixOrigin Manual