Export Microsoft Teams Phone Numbers Using PowerShell

This blog post will show you how to export all the Microsoft Teams phone numbers activated in your tenant.

Microsoft Teams Phone is a cloud-based end to end solution that gives businesses access to advanced voice solutions like Auto-Attendance, Voicemail, call transfer and call queues at a fixed monthly cost.

Teams PowerShell

With the Microsoft Teams PowerShell module, we can manage Teams Phone features without using a single PowerShell module (in the past, you had to use the Skype For Business PowerShell module to manage voice features).

To install the Microsoft Teams PowerShell module, use the following cmdlet.

Install-Module -Name MicrosoftTeams -Force -AllowClobber

Once the Module is installed, we connect to Teams using the cmdlet below.

Connect-MicrosoftTeams -UseDeviceAuthentication

List \ Export Teams Phone Numbers

To list all the active phone numbers under the subscription, use the following cmdlet.

Get-CsOnlineTelephoneNumber | ft Id,ActivationState

To export to a CSV file run.

Get-CsOnlineTelephoneNumber | select Id,ActivationState | export-csv name.csv

To list all active phone numbers and see which user is assigned to each number run.

GET-CSOnlineUser | Where { $_.EnterpriseVoiceEnabled } | Select-Object DisplayName,LineURI


Posted

in

by