Remove-IpamSubnet
Remove-IpamSubnet
Removes a subnet from IPAM.
Syntax
Parameter Set: Query (cdxml)
Remove-IpamSubnet -NetworkId <String[]> [-AddressSpace <String[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-DeleteAssociatedAddresses] [-DeleteAssociatedRanges] [-Force] [-NetworkType <VirtualizationType[]> ] [-PassThru] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: InputObject (cdxml)
Remove-IpamSubnet -InputObject <CimInstance[]> [-AsJob] [-CimSession <CimSession[]> ] [-DeleteAssociatedAddresses] [-DeleteAssociatedRanges] [-Force] [-PassThru] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detaillierte Beschreibung
The Remove-IpamSubnet cmdlet removes a given subnet from IP Address Management (IPAM). By default, the cmdlet returns an error if there are ranges associated with the subnet. You can use the DeleteAssociatedRanges parameter to delete the associated ranges. You can specify the DeleteAssociatedAddresses parameter to delete the associated IP Addresses.
Parameter
-AddressSpace<String[]>
Specifies an array of names of address spaces. If you not specify an address space, the cmdlet removes all address spaces configured in IPAM.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
True (ByPropertyName) |
Platzhalterzeichen akzeptieren? |
false |
-AsJob
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-CimSession<CimSession[]>
Führt das Cmdlet in einer Remotesitzung oder auf einem Remotecomputer aus. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, z. B. die Ausgabe eines Cmdlets New-CimSession oder Get-CimSession. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.
Aliasse |
Session |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-DeleteAssociatedAddresses
Indicates that the cmdlet deletes the addresses associated with these ranges.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-DeleteAssociatedRanges
Indicates that the cmdlet deletes subnets and any associated ranges. If you do not specify this parameter, the cmdlet generates an error when there are ranges associated with the subnet.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Force
Erzwingt, dass der Befehl ohne Benutzerbestätigung ausgeführt wird.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-InputObject<CimInstance[]>
Gibt die Eingabe für dieses Cmdlet an. Sie können diesen Parameter verwenden oder die Eingabe über die Pipeline an dieses Cmdlet übergeben.
Aliasse |
Keiner |
Erforderlich? |
true |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
True (ByValue) |
Platzhalterzeichen akzeptieren? |
false |
-NetworkId<String[]>
Specifies an array of networks for the subnets to remove.
Aliasse |
Keiner |
Erforderlich? |
true |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
True (ByPropertyName) |
Platzhalterzeichen akzeptieren? |
false |
-NetworkType<VirtualizationType[]>
Specifies an array of network types for the subnets to delete. Die folgenden Werte für diesen Parameter sind zulässig:
-- Provider
-- Customer
-- NonVirtualized
If you do not specify a value, all matching IP subnets of network type Provider, Customer and NonVirtualized will be deleted.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
True (ByPropertyName) |
Platzhalterzeichen akzeptieren? |
false |
-PassThru
Gibt ein Objekt zurück, das das Element darstellt, mit dem Sie arbeiten. Standardmäßig wird von diesem Cmdlet keine Ausgabe generiert.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-ThrottleLimit<Int32>
Gibt die maximale Anzahl von gleichzeitigen Vorgängen an, die zum Ausführen dieses Cmdlets eingerichtet werden können. Wenn dieser Parameter ausgelassen 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. Die Drosselungsgrenze gilt nur für das aktuelle Cmdlet und nicht für die Sitzung oder den Computer.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Confirm
Sie werden vor dem Ausführen des Cmdlets zur Bestätigung aufgefordert.
Erforderlich? |
false |
Position? |
named |
Standardwert |
falsch |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-WhatIf
Zeigt, was geschieht, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.
Erforderlich? |
false |
Position? |
named |
Standardwert |
falsch |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
<CommonParameters>
Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Eingaben
Der Eingabetyp ist der Typ der Objekte, die über die Pipeline an das Cmdlet übergeben werden können.
Ausgaben
Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.
IpamSubnet
Represents the subnet deleted from IPAM Server.
Beispiele
Example 1 Remove a non-virtualized subnet with a mapped range
This command removes a NonVirtualized subnet with a mapped range. An error occurs because a subnet cannot be deleted if there are ranges mapped to it
PS C:\> Remove-IpamSubnet -NetworkId 10.12.0.0/16 -NetworkType NonVirtualized
Example 2: Remove a non-virtualized subnet
This command removes a NonVirtualized subnet along with any ranges that are mapped to it. The cmdlet moves the mapped IP addresses to unmapped address space.
PS C:\> Remove-IpamSubnet -NetworkId 10.12.0.0/16 -NetworkType NonVirtualized -DeleteAssociatedRanges
Example 3: Remove a non-virtualized subnet
This command removes a NonVirtualized subnet along with ranges that map to it. Also remove any IP addresses that map to this subnet via the ranges that map to this subnet.
PS C:\> Remove-IpamSubnet -NetworkId 10.12.0.0/16 -NetworkType NonVirtualized -DeleteAssociatedRanges -DeleteAssociatedAddresses
Example 4: Remove a subnet for a provider network type
This command removes a subnet for a provider network type from the default address space.
PS C:\> Remove-IpamSubnet -NetworkId 10.13.0.0/16 -NetworkType Provider -AddressSpace Default -DeleteAssociatedRanges
Example 5: Remove a subnet for a customer network type
This command removes a subnet for a customer network type from the customer address space named Contoso.
PS C:\> Remove-IpamSubnet -NetworkId 10.11.8.0/24 -NetworkType Customer -AddressSpace Contoso -DeleteAssociatedRanges