List All Assigned PSTN numbers in Teams Direct Routing
If you want to list all phone numbers that are assigned to Users, Call Queues or AutoAttendants in Microsoft Teams with direct routing you can use this function: get-AssignedPSTNNumbers -NumberRangeLow 47 12340000 -NumberRangeHigh 47 12341000 47 =Countrycode Note! Exclude the "+" sign. function get-AssignedPSTNNumbers { [CmdletBinding()] param ( [Parameter(Mandatory=$false,Position=1,HelpMessage="Enter the lowest number in the numberrange 472233445566")] [long]$NumberRangeLow, [Parameter(Mandatory=$false,Position=1,HelpMessage="Enter the Higest number in the numberrange, 473344556677")] [long]$NumberRangeHigh ) # get all teams Users with assigned PSTN number in the specified range $NumberArray = @() $OnlineVoiceUsers = get-csonlineuser -Filter {VoicePolicy -EQ "HybridVoice" -and EnterpriseVoiceEnabled -EQ $True}|Select-Object displayname,SipAddress,OnPremLineURI if($OnlineVoiceUsers -ne $null) ...