編集

次の方法で共有


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

Grant-CsOnlineVoiceRoutingPolicy
     [[-Identity] <string>]
     [[-PolicyName] <string>]
     [-PassThru]
     [<CommonParameters>]
Grant-CsOnlineVoiceRoutingPolicy
     [[-PolicyName] <string>]
     [-PassThru]
     [-Global]
     [<CommonParameters>]
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.

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

-Group

Specifies the group used for the group policy assignment.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters: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).

Type:String
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters: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.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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).

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

-Rank

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

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

Outputs

System.Object

Notes

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