Share via


Set-CsNetworkSubnet

 

Topic Last Modified: 2012-03-26

Modifies an existing network subnet.

Syntax

Set-CsNetworkSubnet [-Identity <XdsGlobalRelativeIdentity>] [-Confirm [<SwitchParameter>]] [-Description <String>] [-Force <SwitchParameter>] [-MaskBits <Int32>] [-NetworkSiteID <String>] [-WhatIf [<SwitchParameter>]]

Set-CsNetworkSubnet [-Confirm [<SwitchParameter>]] [-Description <String>] [-Force <SwitchParameter>] [-Instance <PSObject>] [-MaskBits <Int32>] [-NetworkSiteID <String>] [-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 modify the associated network site, change the description of the subnet, or modify the mask bits for the subnet.

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

Parameters

Parameter Required Type Description

Identity

Optional

XdsGlobalRelativeIdentity

The unique subnet ID of the subnet you want to modify. This value will be either an IP address (such as 174.11.12.0) or a URL beginning with http: or https:.

Instance

Optional

SubnetType

A reference to a network subnet object that you want to modify. This object must be of type Microsoft.Rtc.Management.WritableConfig.Settings.NetworkConfiguration.SubnetType, which can be retrieved by calling Get-CsNetworkSubnet.

Description

Optional

String

A description of the subnet being modified.

MaskBits

Optional

Int32

The bitmask to be applied to the subnet.

NetworkSiteID

Optional

String

The site ID of the network site to which this subnet is to be applied. You can retrieve site IDs for your deployment by calling the Get-CsNetworkSite cmdlet.

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 modifies an object of type Microsoft.Rtc.Management.WritableConfig.Settings.NetworkConfiguration.SubnetType.

Example

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

Set-CsNetworkSubnet -Identity 172.11.15.0 -MaskBits 25 -NetworkSiteID Chicago

This example modifies the subnet with the Identity (the Subnet ID) 172.11.15.0. The subnet is modified with a new MaskBits value (25) and a new NetworkSiteID (Chicago).

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

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

Example 2 moves all subnets on the Vancouver site to the Chicago 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 Set-CsNetworkSubnet. We supply one parameter to Set-CsNetworkSubnet: NetworkSiteID. By passing the parameter a value of Chicago, we’re instructing Set-CsNetworkSubnet to change the network site ID of every member of the collection to Chicago.