Forum Discussion

JFM_12's avatar
JFM_12
Iron Contributor
Sep 11, 2023
Solved

Questions to New-CsTeamsUnassignedNumberTreatment

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

 

  • 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

3 Replies

  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    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

    • Carl_Karawani's avatar
      Carl_Karawani
      Copper Contributor

      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:

       

      • JFM_12's avatar
        JFM_12
        Iron Contributor
        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

Resources