Get-CsOnlineVoiceRoutingPolicy

Returns information about the online voice routing policies configured for use in your tenant. Online voice routing policies manage online PSTN usages for users of Phone System.

Syntax

Get-CsOnlineVoiceRoutingPolicy
   [[-Identity] <string>]
   [<CommonParameters>]
Get-CsOnlineVoiceRoutingPolicy
   [-Filter <string>]
   [<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:\> Get-CsOnlineVoiceRoutingPolicy

The command shown in Example 1 returns information for all the online voice routing policies configured for use in the tenant.

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

PS C:\> Get-CsOnlineVoiceRoutingPolicy -Identity "RedmondOnlineVoiceRoutingPolicy"

In Example 2, information is returned for a single online voice routing policy: the policy with the Identity RedmondOnlineVoiceRoutingPolicy.

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

PS C:\> Get-CsOnlineVoiceRoutingPolicy -Filter "tag:*"

The command shown in Example 3 returns information about all the online voice routing policies configured at the per-user scope. To do this, the command uses the Filter parameter and the filter value "tag:*"; that filter value limits the returned data to policies that have an Identity that begins with the string value "tag:".

-------------------------- Example 4 --------------------------

PS C:\> Get-CsOnlineVoiceRoutingPolicy | Where-Object {$_.OnlinePstnUsages -contains "Long Distance"}

In Example 4, information is returned only for those online voice routing policies that include the PSTN usage "Long Distance". To carry out this task, the command first calls Get-CsVoiceRoutingPolicy without any parameters; that returns a collection of all the voice routing policies configured for use in the organization. This collection is then piped to the Where-Object cmdlet, which picks out only those policies where the OnlinePstnUsages property includes (-contains) the usage "Long Distance".

-------------------------- Example 5 --------------------------

PS C:\> Get-CsOnlineVoiceRoutingPolicy | Where-Object {$_.OnlinePstnUsages -notcontains "Long Distance"}

Example 5 is a variation on the command shown in Example 4; in this case, however, information is returned only for those online voice routing policies that do not include the PSTN usage "Long Distance". In order to do that, the Where-Object cmdlet uses the -notcontains operator, which limits returned data to policies that do not include the usage "Long Distance".

Parameters

-Filter

Enables you to use wildcards when retrieving one or more online voice routing policies. For example, to return all the policies configured at the per-user scope, use this syntax:

-Filter "tag:*"

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

-Identity

Unique identifier of the online voice routing policy to be retrieved. To return the global policy, use this syntax:

-Identity global

To return a policy configured at the per-user scope, use syntax like this:

-Identity "RedmondOnlineVoiceRoutingPolicy"

You cannot use wildcard characters when specifying the Identity.

If neither the Identity nor the Filter parameters are specified, then Get-CsOnlineVoiceRoutingPolicy returns all the voice routing policies configured for use in the tenant.

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object