One of the standard PhoneSystem features that Microsoft Teams supports is Caller ID Policies. Masking users direct dials for outbound calls is a pretty common requirement in any organization. Interestingly, when we navigate to the Caller ID Policy, we don’t have a simple option to select a Resource Account number. The use case here, and probably the most common use case, is to mask our outbound calls with the reception number, usually assigned to an Auto Attendant (Check out this article for steps in setting up an Auto Attendant).
For some reason, we still need to set this up via PowerShell. To do this, connect to Microsoft Teams PowerShell, and run the command “Get-CSCallingLineIdentity | fl” to list the Calling Identity Policies in the organization. If there are no custom policies, the you’ll just have the default (Figure 1).
Note: This process requires version 2.3.1 of the Microsoft Teams PowerShell Module
To mask outbound identities, a new policy can be created with the below command:
New-CsCallingLineIdentity -Identity MaskOutbound -Description "Mask outbound calls with the reception DDI"
The existing policy can also be used if the mask should apply to all users. To set the outbound number to an existing Resource Account, run the commands below, specifying either the newly created policy or the default (Global) policy depending on who you want to target. Make sure to replace “email@example.com with the UPN of the resource account you want to mask with as shown in Figure 2.
$ResourceAccount = Get-CsOnlineApplicationInstance -Identity firstname.lastname@example.org Set-CsCallingLineIdentity -Identity global -CallingIDSubstitute resource -ResourceAccount $ResourceAccount.ObjectId
If you made the change to a new or custom Calling ID Policy, make sure to apply the policy to your users with the below command:
Grant-CsCallingLineIdentity -Identity "email@example.com" -PolicyName "Mask Outbound"
There are a lot of tasks, particularly around Direct Routing that are not possible in the Teams Admin Center so it’s definitely worth getting used to the Teams PowerShell module for this type of thing. The updates to the module have been coming thick and fast lately so make sure to keep it updated too.