New-CsOnlinePSTNGateway returns “Can not use the domain as it was not configured for this tenant”

Hi All,

few weeks ago I was stuck creating a new PSTN Gateway for Teams Direct Routing due to a strange error.

This is the PS command (FQDN masked)
New-CsOnlinePSTNGateway -Fqdn -SipSignallingPort 5061 -MaxConcurrentSessions 10 -Enabled $true

and this is the error
Can not use the “” domain as it was not configured for this tenant

Obviously the “” domain was correctly configured on O365, but something was not working

A quick PS command executed on SfB Online found the cause of the issue

$FormatEnumerationLimit =-1
Get-CsTenant | fl Tenantid,Domain*

The “” domain was present in the Domains field, but it was MISSING in the DomainUrlMap field, where was listed only the Customer’s Tenant domain

I opened a Support Ticket, they ask me to:
– create a Global Admin account in Cloud (not synced with AADC) with a UPN and not
– assign a E3 Licence
– wait
– wait
– wait

After few days, the above command return with the domain in the DomainUrlMap.

Now I was able to complete the New-CsOnlinePSTNGateway PS Command and proceed to add a new Teams Direct Routing deployment!

To be sure this was the real solution for this issue, I’ve changed the UPN and SIP Uri of this Admin account to, after few hours the appeared in the DomainUrlMap field.

I hope this could help some of you.

6 thoughts on “New-CsOnlinePSTNGateway returns “Can not use the domain as it was not configured for this tenant”

Add yours

  1. Hi Luca

    Thanks for the post, it’s very helpful. Just wanted to check if there’s any other method (maybe updated) of doing this without waiting for hours or days?

    Thank you


  2. I’m an old hat at linux/SIP but very new to power shell and O365. Without this hint I don’t think I would have got my SBC setup. Thank you so much!

    Liked by 1 person

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

Create a free website or blog at

Up ↑

%d bloggers like this: