Commands › Microsoft Teams

Set-CsOnlineVoiceRoutingPolicy

Microsoft Teams MicrosoftTeams Set-*

Modifies an existing online voice routing policy. Online voice routing policies manage online PSTN usages for Phone System users. For more details, please refer to the article Voice routing policy considerations.

Quick start script

# Set-CsOnlineVoiceRoutingPolicy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-CsOnlineVoiceRoutingPolicy
$before | Format-List

# 3. Make the change (dry run first)
Set-CsOnlineVoiceRoutingPolicy  -WhatIf
Set-CsOnlineVoiceRoutingPolicy

# 4. Verify and diff
$after = Get-CsOnlineVoiceRoutingPolicy
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Set-CsOnlineVoiceRoutingPolicy [[-Identity] <string>] [-Description <string>]
 [-OnlinePstnUsages <Object>] [-RouteType <string>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters (6)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-Description String 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.
-Identity String 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:
-OnlinePstnUsages Object 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...
-RouteType String This parameter is reserved for internal Microsoft use.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.