Skip to main content This browser is no longer supported. Show
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Remove-NetIPAddress
Removes an IP address and its configuration. In this articleSyntax
DescriptionThe 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. ExamplesExample 1: Remove an IP address
This command adds a new IP address. Example 2: Remove an IP address using a pipeline
This command removes all of the IP addresses with the address 192.168.0.1. Example 3: Remove IP addresses by prefix origin
This command removes all of the IP addresses that have a manually-configured prefix origin. Parameters-AddressFamilySpecifies an array of IP address families. The cmdlet removes the IP address that matches the families. The acceptable values for this parameter are: -- IPv4 -- IPv6
-AddressStateSpecifies an array of duplicate address detection (DAD) state values for the IP address. The acceptable values for this parameter are: -- 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.
-AsJobRuns the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
-CimSessionRuns 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.
-ConfirmPrompts you for confirmation before running the cmdlet.
-DefaultGatewaySpecifies 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.
-IncludeAllCompartmentsIndicates 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.
-InputObjectSpecifies the input object that is used in a pipeline command.
-InterfaceAliasSpecifies an array of aliases of network interfaces. The cmdlet removes IP addresses that match the aliases.
-InterfaceIndexSpecifies an array of indexes of network interfaces. The cmdlet removes IP addresses that match the indexes.
-IPAddressSpecifies an array of IPv4 or IPv6 addresses.
-PassThruReturns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
-PolicyStoreSpecifies a PolicyStore value. The acceptable values for this parameter are: -- 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.
-PreferredLifetimeSpecifies an array of values of preferred lifetimes, as TimeSpan objects, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.
-PrefixLengthSpecifies an array of prefix lengths. This parameter defines the local subnet size, and is also known as a subnet mask.
-PrefixOriginSpecifies 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. The acceptable values for this parameter are: -- 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).
-SkipAsSourceIndicates 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.
-SuffixOriginSpecifies 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. The acceptable values for this parameter are: -- 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.
-ThrottleLimitSpecifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of
-TypeSpecifies an array of IP address types. The acceptable values for this parameter are: -- Unicast -- Anycast The default value is Unicast.
-ValidLifetimeSpecifies an array of values of valid lifetimes, as TimeSpan objects, for an IP address. To obtain a TimeSpan object, use the New-TimeSpan cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.
InputsCimInstance The OutputsNone
FeedbackSubmit and view feedback for Which part of a computers IP address configuration indicates the portion of the address?The subnet mask is used in IPv4 and IPv6 to show what part of the address is the network portion and what part of the address is the host portion. In IPv4 there are three default subnet masks corresponding to the three classes of IP addresses (as illustrated earlier).
Which part of an IP address is the network and which part is the host?The first part of an IP address is used as a network address, the last part as a host address. If you take the example 192.168. 123.132 and divide it into these two parts, you get 192.168. 123.
What is the network portion of the IP address?The network part specifies the unique number that is assigned to your network. The network part also identifies the class of network that is assigned. In Figure 5–3, the network part occupies two bytes of the IPv4 address.
How do you determine the network ID of an IP address computers use a logical?To determine the network ID of an IP address, computers use a logical AND operation between the IP address and the subnet mask. The decimal equivalent of the binary number 10000001 is 133. You are the network administrator for a company that uses a private addressing scheme for its internal network.
|