Commands › Microsoft Teams

Grant-CsOnlineVoiceRoutingPolicy

Microsoft Teams MicrosoftTeams Grant-*

Assigns a per-user online voice routing policy to one user, a group of users, or sets the Global policy instance. 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

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

# 2. Run and inspect
Grant-CsOnlineVoiceRoutingPolicy -Group <String> -PolicyName <String> | Format-List

# 3. Export for evidence / drift tracking
Grant-CsOnlineVoiceRoutingPolicy | Export-Clixml .\CsOnlineVoiceRoutingPolicy-$(Get-Date -Format yyyyMMdd).xml

Syntax — 3 parameter sets

Identity (Default)

Grant-CsOnlineVoiceRoutingPolicy [[-Identity] <string>] [[-PolicyName] <string>] [-PassThru] [<CommonParameters>]

GrantToTenant

Grant-CsOnlineVoiceRoutingPolicy [[-PolicyName] <string>] [-PassThru] [-Global] [<CommonParameters>]

GrantToGroup

Grant-CsOnlineVoiceRoutingPolicy [-Group] <string> [[-PolicyName] <string>] [-PassThru] [-Rank <int>] [<CommonParameters>]

Parameters (6)

ParameterTypeRequiredWhat it controls
-Global SwitchParameter When you use this cmdlet without specifying a user identity, the policy applies to all users in your tenant, except any that have an explicit policy assignment. To skip a warning when you do this operation, specify...
-Group String yes Specifies the group used for the group policy assignment.
-Identity String Indicates the Identity of the user account to be assigned the per-user online voice routing policy. User Identities can be specified using one of the following formats: the user's SIP address, the user's user...
-PassThru SwitchParameter Enables you to pass a user object through the pipeline that represents the user account being assigned the online voice routing policy. By default, the `Grant-CsOnlineVoiceRoutingPolicy` cmdlet does not pass objects...
-PolicyName String yes Name of the policy to be assigned. The PolicyName is simply the policy Identity minus the policy scope (the "tag:" prefix). For example, a policy with the Identity tag:Redmond has a PolicyName equal to Redmond;...
-Rank Int32 The rank of the policy assignment, relative to other group policy assignments for the same policy type.

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