Topic Last Modified: 2010-10-01

Removes an existing network region. Network regions represent network hubs or backbones in an enterprise network.

Syntax

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

Parameters

Parameter Required Type Description

Identity

Required

XdsGlobalRelativeIdentity

The unique identifier of the network region you want to remove. The Identity will be in the form of a string that uniquely identifies that region.

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.

Detailed Description

A network region interconnects various parts of a network across multiple geographic areas. Every network region must be associated with a central site. The central site is the data center site on which the bandwidth policy service is running. Use this cmdlet to remove a network region.

Note that a network region cannot be removed if it is associated with a network site (in other words, the NetworkRegionID of any site is equal to the Identity of the region). If you attempt to remove a region associated with a site you’ll receive an error message.

Who can run this cmdlet: By default, members of the following groups are authorized to run the Remove-CsNetworkRegion 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-CsNetworkRegion"}

Input Types

Microsoft.Rtc.Management.WritableConfig.Settings.NetworkConfiguration.NetworkRegionType object. Accepts pipelined input of network region objects.

Return Types

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

Example

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

Copy Code
Remove-CsNetworkRegion -Identity NorthAmerica

Example 1 removes the network region with the Identity NorthAmerica. Because identities are unique this command removes only one network region.

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

Copy Code
Get-CsNetworkRegion | Where-Object {$_.CentralSite -eq "site:Redmond"} | Remove-CsNetworkRegion

This example removes all network regions associated with the central site Redmond. The command begins by calling the Get-CsNetworkRegion cmdlet, with no parameters, to retrieve a collection of all network regions defined for the Microsoft Lync Server 2010 deployment. This collection is then piped to the Where-Object cmdlet. Where-Object filters this collection to return only those items (network regions) where the CentralSite value is equal to (-eq) site:Redmond. After narrowing the collection down to those items, this new collection is piped to Remove-CsNetworkRegion, which removes every item in that collection.

-------------------------- Example 3 --------------------------

Copy Code
Get-CsNetworkSite | Where-Object {$_.NetworkRegionID -eq "NorthAmerica"} | Set-CsNetworkSite -NetworkRegionID $null -BypassID $null
Remove-CsNetworkRegion -Identity "NorthAmerica"

This example removes the network region with the Identity NorthAmerica. However, a region cannot be removed if it is associated with a site. So this example first removes any association between the NorthAmerica region and a site.

The example begins by calling the Get-CsNetworkSite cmdlet, with no parameters, to retrieve a collection of all network sites defined for the Lync Server deployment. This collection is then piped to the Where-Object cmdlet. Where-Object filters this collection to return only those items (network sites) where the NetworkRegionID value is equal to (-eq) NorthAmerica. After narrowing the collection down to those items, this new collection is piped to Set-CsNetworkSite. For each site containing the NetworkRegionID NorthAmerica, we set the NetworkRegionID to Null ($null). This removes the reference to the region on that site. However, a site can’t have a bypass ID if it isn’t associated with a site. So in addition to removing the reference to the region by setting the NetworkRegionID to Null, we must also remove the bypass association by setting BypassID to Null.

After line 1 completes, any site that was associated with the NorthAmerica region is no longer tied to a region or to any bypass settings. At this point we can call line 2, which removes the network region.

See Also