Edit

Share via


Grant-CsOnlineVoiceRoutingPolicy

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.

Syntax

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>]

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

Grant-CsOnlineVoiceRoutingPolicy -Identity Ken.Myer@contoso.com -PolicyName "RedmondOnlineVoiceRoutingPolicy"

The command shown in Example 1 assigns the per-user online voice routing policy RedmondOnlineVoiceRoutingPolicy to the user ken.myer@contoso.com.

Example 2

Grant-CsOnlineVoiceRoutingPolicy -Identity Ken.Myer@contoso.com -PolicyName $Null

In Example 2, any per-user online voice routing policy previously assigned to the user Ken Myer is unassigned from that user; as a result, Ken Myer will be managed by the global online voice routing policy. To unassign a per-user policy, set the PolicyName to a null value ($null).

Example 3

Get-CsOnlineUser | Grant-CsOnlineVoiceRoutingPolicy -PolicyName "RedmondOnlineVoiceRoutingPolicy"

Example 3 assigns the per-user online voice routing policy RedmondOnlineVoiceRoutingPolicy to all the users in the tenant. To do this, the command first calls the Get-CsOnlineUser cmdlet to get all user accounts enabled for Microsoft Teams or Skype for Business Online. Those user accounts are then piped to the Grant-CsOnlineVoiceRoutingPolicy cmdlet, which assigns each user the online voice routing policy RedmondOnlineVoiceRoutingPolicy.

Example 4

Grant-CsOnlineVoiceRoutingPolicy -PolicyName "RedmondOnlineVoiceRoutingPolicy" -Global

Example 4 assigns the per-user online voice routing policy RedmondOnlineVoiceRoutingPolicy as the global online voice routing policy. This affects all the users in the tenant, except any that have an explicit policy assignment.

Example 5

Grant-CsOnlineVoiceRoutingPolicy -Group sales@contoso.com -Rank 10 -PolicyName "RedmondOnlineVoiceRoutingPolicy"

Example 5 assigns the online voice routing policy RedmondOnlineVoiceRoutingPolicy to all members of the group sales@contoso.com.

Parameters

-Global

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 this parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GrantToTenant
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Group

Specifies the group used for the group policy assignment.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GrantToGroup
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Identity

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 principal name (UPN), or the user's Active Directory display name (for example, Ken Myer).

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Identity
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-PassThru

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 through the pipeline.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PolicyName

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; likewise, a policy with the Identity tag:RedmondOnlineVoiceRoutingPolicy has a PolicyName equal to RedmondOnlineVoiceRoutingPolicy.

To unassign a per-user policy previously assigned to a user, set the PolicyName to a null value ($Null).

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Rank

The rank of the policy assignment, relative to other group policy assignments for the same policy type.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GrantToGroup
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

System.Object

Notes

The GrantToGroup syntax is supported in Teams PowerShell Module 4.5.1-preview or later.