Set-CsOnlineVoiceRoutingPolicy

Modifies an existing online voice routing policy. Online voice routing policies manage online PSTN usages for Phone System users.

Syntax

Set-CsOnlineVoiceRoutingPolicy
   [-Tenant <Guid>]
   [-OnlinePstnUsages <PSListModifier>]
   [-Description <String>]
   [-RouteType <String>]
   [[-Identity] <XdsIdentity>]
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CsOnlineVoiceRoutingPolicy
   [-Tenant <Guid>]
   [-OnlinePstnUsages <PSListModifier>]
   [-Description <String>]
   [-RouteType <String>]
   [-Instance <PSObject>]
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Online voice routing policies are used in Microsoft Phone System Direct Routing scenarios. Assigning your Teams users an online voice routing policy enables those users to receive and to place phone calls to the public switched telephone network by using your on-premises SIP trunks.

Note that simply assigning a user an online voice routing policy will not enable them to make PSTN calls via Teams. Among other things, you will also need to enable those users for Phone System and will need to assign them an appropriate online voice policy.

Examples

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

PS C:\> Set-CsOnlineVoiceRoutingPolicy -Identity "RedmondOnlineVoiceRoutingPolicy" -OnlinePstnUsages @{Add="Long Distance"}

The command shown in Example 1 adds the online PSTN usage "Long Distance" to the per-user online voice routing policy RedmondOnlineVoiceRoutingPolicy.

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

PS C:\> Set-CsOnlineVoiceRoutingPolicy -Identity "RedmondOnlineVoiceRoutingPolicy" -OnlinePstnUsages @{Remove="Local"}

In Example 2, the online PSTN usage "Local" is removed from the per-user online voice routing policy RedmondOnlineVoiceRoutingPolicy.

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

PS C:\> Set-CsOnlineVoiceRoutingPolicy | Where-Object {$_.OnlinePstnUsages -contains "Local"} | Set-CsOnlineVoiceRoutingPolicy -OnlinePstnUsages @{Remove="Local"}

Example 3 removes the online PSTN usage "Local" from all the online voice routing policies that include that usage. In order to do this, the command first calls the Get-CsOnlineVoiceRoutingPolicy cmdlet without any parameters in order to return a collection of all the available online voice routing policies. That collection is then piped to the Where-Object cmdlet, which picks out only those policies where the OnlinePstnUsages property includes (-contains) the "Local" usage. Those policies are then piped to the Set-CsOnlineVoiceRoutingPolicy cmdlet, which deletes the Local usage from each policy.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

Enables administrators to provide explanatory text to accompany an online voice routing policy. For example, the Description might include information about the users the policy should be assigned to.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

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

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Identity

Unique identifier assigned to the policy when it was created. Online voice routing policies can be assigned at the global scope or the per-user scope. To refer to the global instance, use this syntax:

-Identity global

To refer to a per-user policy, use syntax similar to this:

-Identity "RedmondOnlineVoiceRoutingPolicy"

If you do not specify an Identity, then the Set-CsOnlineVoiceRoutingPolicy cmdlet will modify the global policy.

Type:XdsIdentity
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Instance

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

Type:PSObject
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-OnlinePstnUsages

A list of online PSTN usages (such as Local or Long Distance) that can be applied to this online voice routing policy. The online PSTN usage must be an existing usage. (PSTN usages can be retrieved by calling the Get-CsOnlinePstnUsage cmdlet.)

Type:PSListModifier
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RouteType

This parameter is reserved for internal Microsoft use.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Tenant

Globally unique identifier (GUID) of the tenant account whose online voice routing policies are being changed. For example:

-Tenant "38aad667-af54-4397-aaa7-e94c79ec2308"

You can return your tenant ID by running this command:

Get-CsTenant | Select-Object DisplayName, TenantID

If you are using a remote session of Windows PowerShell and are connected only to Skype for Business Online you do not have to include the Tenant parameter. Instead, the tenant ID will automatically be filled in for you based on your connection information. The Tenant parameter is primarily for use in a hybrid deployment.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Management.Automation.PSObject

Outputs

System.Object