Annex 4: Assign phone number using PowerShell
If it is impossible to assign a phone number via the Microsoft interface
-
Open Windows PowerShell or PowerShell (no Elevated Permissions are needed)
- Make sure to use 64-bit version of PowerShell
-
Run the following PowerShell command to login to Microsoft Teams
-
Login with a Microsoft User Account that has either one of these permissions
- Global Administrator;
- Teams Administrator; or
- 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 -
Run the following PowerShell command to assign a phone number to the resource account
- Provide the correct identity (username@domain.com)
- Provide the correct phone number
- Provide the correct phone number type
- CallingPlan
- DirectRouting
- OperatorConnect
CopyPowerShellSet-CsPhoneNumberAssignment -Identity user@domain.com -PhoneNumber +1000000000 -PhoneNumberType CallingPlan
-
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.
CopyPowerShellGet-CsOnlineApplicationInstance -Identity 'user@domain.com' | SELECT UserPrincipalName, PhoneNumber