Quick Fix: Invalid overflow action target in Microsoft Teams
July 6, 2023 Leave a comment
So, you want to automate the creation of Microsoft Teams Call Queues. You want to use Shared Voicemail and the target is a Unified Group. But wait, what’s this, invalid overflow action target?
As you can see above we are using a variable $unifiedGroup, and selecting the id of that object. This is derived from an earlier command ‘Get-UnifiedGroup‘.
You might be forgiven for thinking that the Group Id is the right property to use, given the New-CsCallQueue documentation which states:
The OverflowActionTarget parameter represents the target of the overflow action. If the OverFlowAction is set to Forward, this parameter must be set to a Guid or a telephone number with a mandatory ‘tel:’ prefix. If the OverflowAction is set to SharedVoicemail, this parameter must be set to a group ID (Microsoft 365, Distribution list, or Mail-enabled security). Otherwise, this parameter is optional.
Looking at the output of $unifiedGroup we can see several properties that reference id.
The obvious ones though are not right. Identity, id, ExchangeObjectId, all incorrect.
So what’s the right value?
That’s right. The ExternalDirectoryObjectId.
So, update your PowerShell code to use that property instead and your Queue will be created successfully.