COMMAND EVERYTHING.
Removes an IP address and its configuration.
Microsoft NetTCPIP reference: Removes an IP address and its configuration. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for Remove-NetIPAddress. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Windows / NetTCPIP · Windows Server 2025 documentation; feature/module prerequisites apply
-AddressFamily- Specifies 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
-AddressState- Specifies 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.
-AsJob- Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
-CimSession- Runs 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.
-Confirm- Prompts you for confirmation before running the cmdlet.
-DefaultGateway- 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.
-IPAddress- Specifies an array of IPv4 or IPv6 addresses.
-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.
-InputObject (required)- Specifies the input object that is used in a pipeline command.
-InterfaceAlias- Specifies an array of aliases of network interfaces. The cmdlet removes IP addresses that match the aliases.
-InterfaceIndex- Specifies an array of indexes of network interfaces. The cmdlet removes IP addresses that match the indexes.
-PassThru- Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
-PolicyStore- Specifies 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.
-PreferredLifetime- 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.
-PrefixLength- Specifies an array of prefix lengths. This parameter defines the local subnet size, and is also known as a subnet mask.
-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. 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).
-SkipAsSource- 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.
-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. 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.
-ThrottleLimit- Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.
-Type- Specifies an array of IP address types. The acceptable values for this parameter are: -- Unicast -- Anycast The default value is Unicast.
-ValidLifetime- 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.
-WhatIf- Shows what would happen if the cmdlet runs. The cmdlet is not run.
Windows with the NetTCPIP module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.