Administrator

Annex 4: Assign phone number using PowerShell

If it is impossible to assign a phone number via the Microsoft interface

  1. Open Windows PowerShell or PowerShell (no Elevated Permissions are needed)

    1. Make sure to use 64-bit version of PowerShell
  2. Run the following PowerShell command to login to Microsoft Teams

    Copy
    PowerShell
    Connect-MicrosoftTeams
  3. Login with a Microsoft User Account that has either one of these permissions

    1. Global Administrator;
    2. Teams Administrator; or
    3. Teams Communications Administrator

    To learn how to assign user roles with Azure Active Directory please visit:
    Add an existing Azure subscription to your tenant | Microsoft Learn

  4. Run the following PowerShell command to assign a phone number to the resource account

    1. Provide the correct identity (username@domain.com)
    2. Provide the correct phone number
    3. Provide the correct phone number type
      1. CallingPlan
      2. DirectRouting
      3. OperatorConnect
    Copy
    PowerShell
    Set-CsPhoneNumberAssignment -Identity user@domain.com -PhoneNumber +1000000000 -PhoneNumberType CallingPlan
  5. Run the following PowerShell command to verify if the Phone Number is assigned successfully.

    Please note

    Replace username@domain.com with the actual username and domain you provided when creating the resource account.

    Copy
    PowerShell
    Get-CsOnlineApplicationInstance -Identity 'user@domain.com' | SELECT UserPrincipalName, PhoneNumber

Environment

minute to read