Share via


Set-CsStaticRoutingConfiguration

 

Topic Last Modified: 2012-03-26

Modifies an existing collection of static routing configuration settings.

Syntax

Set-CsStaticRoutingConfiguration [-Identity <XdsIdentity>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Route <PSListModifier>] [-WhatIf [<SwitchParameter>]]

Set-CsStaticRoutingConfiguration [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Instance <PSObject>] [-Route <PSListModifier>] [-WhatIf [<SwitchParameter>]]

Detailed Description

When you send a SIP message to someone that message might need to traverse multiple subnets and networks before it is delivered; the path traveled by the message is often referred to as a route. In networking, there are two types of routes: dynamic and static. With dynamic routing, servers use algorithms to determine the next location (the next hop) where a message should be forwarded. With static routing, message paths are predetermined by system administrators. When a message is received by a server, the server checks the message address and then forwards the message to the next hop server that has been preconfigured by an administrator. If configured correctly, static routes help ensure timely, and accurate, delivery of messages, and with minimal overheard placed on servers. The downside to static routes is that messages are not dynamically rerouted in the event of a network failure.

When you install Microsoft Lync Server 2010, a global collection of static routes is automatically created for you. (The collection is created, but there are no routes assigned to that collection.) In addition, the software enables you to create additional collections applied to the service scope (these new collections can only be assigned to the Registrar service). The Set-CsStaticRoutingConfiguration cmdlet enables you to modify the property values of an existing static routing collection. This means that you can use the cmdlet to add new routes to a collection, or to delete existing routes from a collection.

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

Parameters

Parameter Required Type Description

Identity

Optional

Xds Identity

Unique identifier of the static routing configuration collection to be modified. To modify the global collection, use this syntax: -Identity global. To modify a collection applied to the service scope, use syntax similar to this: -Identity "service:Registrar:atl-cs-001.litwareinc.com". You cannot use wildcards when specifying the Identity.

If this parameter is not included Set-CsStaticRoutingConfiguration will automatically modify the global collection.

Instance

Optional

RoutingSettings object

Allows you to pass a reference to an object to the cmdlet rather than set individual parameter values.

Route

Optional

PS List Modifier

Individual static routes maintained within the collection. Routes to be added to a collection must either be copied from another collection or created by using the New-CsStaticRoute cmdlet; to delete a route from a collection, you must first create an object reference to that route. For details, see the Examples section of help topic.

Force

Optional

Switch Parameter

Suppresses the display of any non-fatal error message that might occur when running the command.

WhatIf

Optional

Switch Parameter

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

Confirm

Optional

Switch Parameter

Prompts you for confirmation before executing the command.

Input Types

Microsoft.Rtc.Management.WritableConfig.Settings.SipProxy.RoutingSettings object. Set-CsStaticRoutingConfiguration accepts pipelined instances of the static routing settings object.

Return Types

Set-CsStaticRoutingConfiguration does not return a value or object. Instead, the cmdlet configures instances of the Microsoft.Rtc.Management.WritableConfig.Settings.SipProxy.RoutingSettings object.

Example

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

$x = Get-CsStaticRoutingConfiguration -Identity global | Select-Object -ExpandProperty Route | Where-Object {$_.MatchUri -eq "litwareinc.com" -and $_.MatchOnlyPhoneUri -eq $True}

Set-CsStaticRoutingConfiguration -Identity service:Registrar:atl-cs-001.litwareinc.com -Route @{Add=$x}

The commands shown in Example 1 copy a route from the global static routing collection, and then assign that route to a second static routing collection, one with the Identity service:Registrar:atl-cs-001.litwareinc.com. To carry out this task, the first command in the example connects to the global collection and returns an object reference to the route with the MatchUri litwareinc.com and a MatchOnlyPhoneUri equal to True.

To do this, the command calls Get-CsStaticRoutingConfiguration to return information from the global routing static configuration collection. This data is then piped to the Select-Object cmdlet, which uses the ExpandProperty parameter to expand the values in the Route property. These expanded values (which represent the individual routes assigned to the collection) are then piped to the Where-Object cmdlet, which picks out the one route where the MatchUri property is equal to litwareinc.com and the MatchOnlyPhoneUri property is equal to True. The returned route is stored in a variable named $x.

After the route has been retrieved, the second command in the example adds that route to the service: Registrar:atl-cs-001.litwareinc.com collection. To do this, Set-CsStaticRoutingConfiguration is called along with the Route parameter; the parameter value @{Add=$x} instructs Set-CsStaticRoutingConfiguration to append the route stored in the variable $x to the collection of routes maintained in the Route property.

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

$x = Get-CsStaticRoutingConfiguration -Identity service:Registrar:atl-cs-001.litwareinc.com | Select-Object -ExpandProperty Route | Where-Object {$_.MatchUri -eq "litwareinc.com" -and $_.MatchOnlyPhoneUri -eq $True}

Set-CsStaticRoutingConfiguration -Identity service:Registrar:atl-cs-001.litwareinc.com -Route @{Remove=$x}

The preceding commands delete a route from a static routing collection. To do this, the first command in the example connects to the collection with the Identity service:Registrar:atl-cs-001.litwareinc.com and returns an object reference to the route with the MatchUri litwareinc.com and a MatchOnlyPhoneUri equal to True. To do that, the command calls Get-CsStaticRoutingConfiguration to return information from the service:Registrar:atl-cs-001.litwareinc.com collection. This data is then piped to the Select-Object cmdlet, which uses the ExpandProperty parameter to expand the values in the Route property. These expanded values (which represent the individual routes assigned to the collection) are then piped to the Where-Object cmdlet, which picks out the one route where the MatchUri property is equal to litwareinc.com and the MatchOnlyPhoneUri property is equal to True. The returned route in then stored in a variable named $x.

After the route has been retrieved, the second command deletes that route from the collection. To do this, Set-CsStaticRoutingConfiguration is called along with the Route parameter; the parameter value @{Remove=$x} instructs Set-CsStaticRoutingConfiguration to delete the route stored in the variable $x.

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

Set-CsStaticRoutingConfiguration -Identity service:Registrar:atl-cs-001.litwareinc.com -Route $Null

Example 3 shows how you can remove all the routes assigned to a static routing configuration collection. To do this, simply include the Route parameter and set the parameter value to null. After the command completes, the collection will still exist, but it will no longer have any routes assigned to it.