SOLVED

Questions to New-CsTeamsUnassignedNumberTreatment

Iron Contributor

Hello

I would like to use the command "New-CsTeamsUnassignedNumberTreatment" and have different questions.

 

1. Pattern

Can I define in the Powershell "from" "to" with 2 fix numbers?

i.e. from 1234567 to 1234570

 

Thank you for your answer

 

Regards

 

JFM_12

 

3 Replies
best response confirmed by JFM_12 (Iron Contributor)
Solution

Hi @JFM_12,

when using the New-CsTeamsUnassignedNumberTreatment cmdlet in Microsoft Teams to handle unassigned phone numbers, you can define a pattern for incoming calls.

However, specifying a range like "from 1234567 to 1234570" directly in the Pattern parameter isn't supported.

Instead of that, you could use wildcards to define a pattern. For example, you can use `123456[7-0]` to match any number in the range from 1234567 to 1234570. The `[7-0]` represents a character set that includes digits 7, 8, 9, and 0.

This allows you to cover the desired range by crafting a pattern with the appropriate wildcards.


I hope this helps clarify how to define a pattern for your needs with the `New-CsTeamsUnassignedNumberTreatment` cmdlet. 

New-CsTeamsUnassignedNumberTreatment (MicrosoftTeamsPowerShell) | Microsoft Learn

Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.


If the post was useful in other ways, please consider giving it Like.


Kindest regards,


Leon Pavesic

@JFM_12  You could also leverage Teams Admin Center, to generate the expressions for you. 

Under PhoneNumbers --> Routing Rules there's a GUI to view/build new rules and it generates the expressions for you:

Carl_Karawani_0-1694721187348.png

 

Hello
The problem was that I had 350 unassigned number configurations and wanted to automatize it.
We did most of it by powershell. I searched for a tool to generate it in bulk.
Thank you for your support
Regards
JFM_12
1 best response

Accepted Solutions
best response confirmed by JFM_12 (Iron Contributor)
Solution

Hi @JFM_12,

when using the New-CsTeamsUnassignedNumberTreatment cmdlet in Microsoft Teams to handle unassigned phone numbers, you can define a pattern for incoming calls.

However, specifying a range like "from 1234567 to 1234570" directly in the Pattern parameter isn't supported.

Instead of that, you could use wildcards to define a pattern. For example, you can use `123456[7-0]` to match any number in the range from 1234567 to 1234570. The `[7-0]` represents a character set that includes digits 7, 8, 9, and 0.

This allows you to cover the desired range by crafting a pattern with the appropriate wildcards.


I hope this helps clarify how to define a pattern for your needs with the `New-CsTeamsUnassignedNumberTreatment` cmdlet. 

New-CsTeamsUnassignedNumberTreatment (MicrosoftTeamsPowerShell) | Microsoft Learn

Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.


If the post was useful in other ways, please consider giving it Like.


Kindest regards,


Leon Pavesic

View solution in original post