Quick Fix: Invalid overflow action target in Microsoft Teams

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.

https://learn.microsoft.com/en-us/powershell/module/skype/new-cscallqueue?view=skype-ps#-overflowactiontarget

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.

About Robert Pearman
Robert Pearman is a UK based IT worker bee. He has been working within the IT Industry for what feels like forever. Robert likes Piña colada and getting caught in the rain, he also enjoys writing about Technology like PowerShell or System Automation but not as much as he used to. If you're in trouble, and you can find him, maybe you can ask him a question.

Leave a reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.