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 “firstname.lastname@example.org with the UPN of the resource account you want to mask with as shown in Figure 2.
$ResourceAccount = Get-CsOnlineApplicationInstance -Identity email@example.com 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 "firstname.lastname@example.org" -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.
14 thoughts on “Replace Teams Outbound Caller ID with Resource Account Number”
Did you have any issues with the -CompanyName attribute for set-cscallinglineidentity? I set up my company name along with the resource account object ID info. I can see the resource account phone and location, but not the name I put as the callerID. Strange…
Hey, I didn’t have a specific issue and it is a supported parameter, did you get a specific error?
Thanks for this post, but it should read:
Set-CsCallingLineIdentity -Identity global -CallingIDSubstitute resource -ResourceAccount $ObjId
Thanks for pointing this out, hopefully people got the right command from the screenshot, I’ve updated the post now!
thank you for sharing this post.
I already follow every step you wrote including putting the resource number on Global CallingLineIdentity and set EnableUserOverride to false, but OnpremLineURI from user still gets through. Do these steps apply to Direct Routing, too?
Nevermind my question. I forgot to set ForwardPAI to $false. Now it is working like a charm.
Thank you very much
Hi Gabriel, yes they should work however there was a typo in the “Set-CSCallingLineIdentity” command which has been pointed out and updated now!
Hi Sean, do you know if it’s possible to use outbound caller id in combination with direct routing? We have the SBC hosted by a third party, so if it is possible to do that, I would be able to set it up for particular users in our organization without having to create a support ticket with them.
Hi Christian, yes this should work with Direct Routing, are you seeing an error?
I didn’t notice the typo at first, I got it working now. Thanks for your help!
Awesome, great to hear you got it working 🙂
Hi there, I’m using Direct Routing with a third party provider (they manage the SBC) I’m trying to setup the Caller ID for some of our users to a Toll Free Number (i.e. 1888XXXXXXX). I followed the steps and it is working intermittently (Some calls get out without issue but most of them failed with a message saying “The person you’re trying to reach isn’t available”). Have any of you got something like this working with a TFN? One other note: the TFN that we are using is not part of the telco that provides the SBC/Trunk, the TFN belong to us but is with another telco provider so basically we are “spoofing” the TFN. Thanks for any help!
Generally when you see this it would be a routing issue on the provider. If calls are getting through intermittently then your config is working. One thing to note is that many Telcos are locking down “spoofing” of numbers – particularly across different countries.
Never mind, Gabriel Wishnu’s suggestion to turn off ForwardPAI (or set to $false if using powers shell) for the SBC configured under Teams Direct Routing did the trick for me as well. My SIP Trunk traffic now contains the Reference account phone number as the from number.