Upload Direct Routing Telephone Numbers to Teams Admin Center

Deploy the New-CsDirectRoutingInventoryUpload script to provide number management functionality for Direct Routing as a Service customers


In this article

Introduction

This guide is intended for the customer to be able to implement the LoopUp New-CsDirectRoutingInventoryUpload script to provide number management functionality for Direct Routing as a Service customers.

What is the "Direct Routing Telephone Number Upload"?

Microsoft now allows customers to upload Direct Routing telephone numbers so they can be viewed within Teams Admin Center in the online inventory, just as you already have for Microsoft Calling Plan and for Operator Connect numbers. This gives customers greater visibility of their number estate within Teams.

What does the script do?

The script will aid in the normalisation of the number format to make sure that valid numbers are able to be assigned to users and resources.

The script will then execute the following:

  1. Remove from the batch any existing Direct Routing numbers that are already present in the tenant before providing a list of optimized ranges of contiguous numbers with which to create the number upload orders
  2. The script will then create the upload orders, which Microsoft then processes asynchronously until all have completed

Prerequisites

  • PowerShell 7.5 or later
  • MicrosoftTeams PowerShell module 6.7.1 or later
  • Teams Telephony Administrator role as a minimum (also works under Teams Communications Admin, Teams Administrator and Global Administrator)
  • Phone Number data collected ready via clipboard, text files or CSV (using a single column of data headed PhoneNumbers) in any of the below formats:
441231234567
441231234100-441231234199
441231234250 - 441231234256
441231234560,441231234572,
441231234275~441231234279
441231234582
441231234593-441231234596
441231234002,441231234006
441231234599
+441231237000-+441231239999
💡Anything the script doesn't recognise as being in one of the above formats,  the source data affected will be presented and the user can manually correct it to a number or range in an acceptable format. 

Deployment

  1. Run the provided "New-CsDirectRoutingInventoryUpload.ps1" script from the folder you saved it to
  2. The script will prompt you to connect to the Microsoft 365 tenant if not already connected. The script will then inform you that it is obtaining a cache of the current phone number inventory from the tenant
  3. You will then be asked to choose your data source, Clipboard or File
  4. If you select Clipboard, it will check that you have numeric or phone data available in the clipboard and prompt you for any manual corrections needed. If you select File, you will be prompted to select a .TXT or .CSV file from your computer
  5. The script will then create the orders and open a form to show progress of the orders through to completion
  6. After all orders' status is 'Success', the form automatically closes; the timestamp on the bottom of the form will update after each check so you know the script is still active 
  7. The script then prompts the user to select a folder for job output, which consists of:
    1. An XML dump of the order details; if there are any failed numbers in any of the orders, there will be a warning shown on screen with the affected order number and the XML output will contain the details of the failed numbers for investigation.
    2. If any numbers needed to be removed from the batch because they already exist in the number inventory, an XML dump of the omitted numbers will be created, detailing the number, the type (Direct Routing, Operator Connect or Calling Plan) and the GUID of the currently assigned user account.
💡Expect 30-60 seconds for a range of 1000 numbers to be processed - Microsoft executes the upload orders in parallel rather than consecutively

 

  • Microsoft Teams
  • PowerShell
  • Direct Routing as a Service