Share via


Remove-CsNetworkSubnet

 

Topic Last Modified: 2012-03-27

Removes an existing network subnet.

Syntax

Remove-CsNetworkSubnet -Identity <XdsGlobalRelativeIdentity> [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Detailed Description

Each subnet must be associated with a network site for the purposes of determining the geographic location of the host belonging to this subnet. Use this cmdlet to remove a network subnet.

Who can run this cmdlet: By default, members of the following groups are authorized to run the Remove-CsNetworkSubnet cmdlet locally: RTCUniversalServerAdmins. To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself), run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets –match "Remove-CsNetworkSubnet"}

Parameters

Parameter Required Type Description

Identity

Required

XdsGlobalRelativeIdentity

The unique subnet ID of the subnet you want to remove. This value will be an IP address (such as 174.11.12.0).

Force

Optional

SwitchParameter

Suppresses any confirmation prompts that would otherwise be displayed before making changes.

WhatIf

Optional

SwitchParameter

Describes what would happen if you executed the command without actually executing the command.

Confirm

Optional

SwitchParameter

Prompts you for confirmation before executing the command.

Input Types

Microsoft.Rtc.Management.WritableConfig.Settings.NetworkConfiguration.SubnetType object. Accepts pipelined input of network subnet objects.

Return Types

This cmdlet does not return a value. It removes an object of type Microsoft.Rtc.Management.WritableConfig.Settings.NetworkConfiguration.SubnetType.

Example

-------------------------- Example 1 --------------------------

Remove-CsNetworkSubnet -Identity 172.11.15.0

This example removes the subnet with the Identity (the Subnet ID) 172.11.15.0.

-------------------------- Example 2 --------------------------

Get-CsNetworkSubnet | Where-Object {$_.NetworkSiteID -eq "Vancouver"} | Remove-CsNetworkSubnet

Example 2 removes all subnets associated with the Vancouver site. To do this, we begin by calling the Get-CsNetworkSubnet cmdlet. This will retrieve a collection of all subnets defined within the Microsoft Lync Server 2010 deployment. This collection of subnets is then piped to the Where-Object cmdlet. Where-Object takes that collection and narrows it down to only those subnets with a NetworkSiteID equal to (-eq) Vancouver. Now that the collection consists only of subnets associated with the Vancouver site, we pipe the collection to Remove-CsNetworkSubnet, which removes every item in the collection.