How to Configure Teams Phone Location-Based Routing Policies in PowerShell Using CsTeamsLocationBasedRoutingPolicy

In multinational enterprises utilizing Microsoft Teams Direct Routing, telecommunications regulations in specific countries (such as India and other telecom regulatory jurisdictions) strictly prohibit bypassing public switched telephone network (PSTN) toll charges. Specifically, regulations mandate that VoIP calls between international branch offices must not break out onto local PSTN trunks in another jurisdiction without traversing certified national carrier lines. To enforce regulatory compliance and prevent illegal toll bypass, Microsoft Teams Phone System implements Location-Based Routing (LBR). In the Microsoft Teams PowerShell administration module, administrators configure toll-bypass restrictions, transfer permissions, and routing boundaries using the *-CsTeamsLocationBasedRoutingPolicy cmdlets.

Understanding Teams Location-Based Routing (LBR) Architecture

Location-Based Routing restricts the routing of calls between Teams endpoints and PSTN gateways based on the physical geographic location of the caller and recipient:

  • Network Sites and Subnets: The Teams client determines its physical location by mapping its current IP address to a defined CsTenantNetworkSubnet associated with a CsTenantNetworkSite.
  • LBR-Enabled Sites: Network sites can have LocationBasedRoutingEnable $true configured. When a user connects from an LBR-enabled site, Teams enforces strict routing rules.
  • Voice Routing Policy Enforcement: When an LBR-enabled user places an outbound PSTN call, the call can only egress through the local Session Border Controller (SBC) gateway provisioned for that specific physical site, preventing remote trunk breakout.
  • Consultative Transfer and Call Forwarding: LBR policies regulate whether an external PSTN caller can be transferred across internal VoIP networks to a user located in another geographic site or country.

Connecting to the Microsoft Teams PowerShell Module

Managing Location-Based Routing policies requires Teams Administrator or Global Administrator privileges in Microsoft 365. Open an elevated PowerShell session and connect:

# Install Microsoft Teams module if not present
Install-Module -Name MicrosoftTeams -Force -AllowClobber

# Authenticate to tenant
Connect-MicrosoftTeams

Inspecting Existing Location-Based Routing Policies

To inspect all Location-Based Routing policies currently active within your tenant, execute:

Get-CsTeamsLocationBasedRoutingPolicy

To inspect detailed configuration properties for a specific policy:

Get-CsTeamsLocationBasedRoutingPolicy -Identity "India-TollBypass-Policy" | Select-Object Identity, Description | Format-List

Creating a New Location-Based Routing Policy with New-CsTeamsLocationBasedRoutingPolicy

To create a new policy object that enforces toll-bypass restrictions for specific regional users or branch sites, use the New-CsTeamsLocationBasedRoutingPolicy cmdlet:

# Create custom LBR policy for Indian branch offices
New-CsTeamsLocationBasedRoutingPolicy `
  -Identity "India-LBR-Enforced" `
  -Description "Enforces strict toll-bypass prevention for Indian enterprise sites"

Verify that the policy registers in the tenant policy catalog:

Get-CsTeamsLocationBasedRoutingPolicy -Identity "India-LBR-Enforced"

Configuring Associated Network Sites and Gateways for LBR

A Location-Based Routing policy operates in concert with physical network site configurations and SBC gateway settings. To ensure LBR is fully effective, administrators must complete the configuration across network sites and gateways.

Step 1: Enable LBR on the Physical Network Site

Ensure that the target network site has Location-Based Routing enabled:

Set-CsTenantNetworkSite -Identity "Mumbai-Branch-Site" `
  -LocationBasedRoutingEnable $true

Step 2: Enable LBR on the Local Session Border Controller (SBC)

Configure the local SBC gateway serving the site to enforce Location-Based Routing:

# Enable Location-Based Routing on local branch SBC gateway
Set-CsOnlinePSTNGateway -Identity "sbc-mumbai.contoso.com" `
  -MediaBypass $false

Note: When LBR is active on an SBC gateway, Media Bypass must be set to $false to ensure Microsoft Cloud Media Processors can continuously validate caller location during active calls.

Assigning Location-Based Routing Policies to Users

Once created, assign the policy to individual employees or entire security groups located within the regulated region.

Assigning Policy to an Individual User

Grant-CsTeamsLocationBasedRoutingPolicy `
  -Identity "[email protected]" `
  -PolicyName "India-LBR-Enforced"

Assigning Policy Across an Entra ID Security Group

To automate policy inheritance for all personnel assigned to a regional branch office:

# Retrieve Group ObjectId
$GroupId = (Get-AzureADGroup -SearchString "Mumbai-Office-Staff").ObjectId

# Assign LBR policy with priority ranking
New-CsGroupPolicyAssignment `
  -GroupId $GroupId `
  -PolicyType TeamsLocationBasedRoutingPolicy `
  -PolicyName "India-LBR-Enforced" `
  -Rank 1

Removing a Location-Based Routing Policy

When a regulatory policy is phased out or merged into a standardized framework, remove all user assignments before deleting the policy entity:

# Remove the custom policy
Remove-CsTeamsLocationBasedRoutingPolicy -Identity "India-LBR-Enforced" -Confirm:$false

Validating LBR Call Flow Mechanics

To verify that Location-Based Routing rules are actively evaluated, perform a test call with a user assigned the policy:

  1. When the user is connected to their assigned corporate site subnet (e.g., Mumbai-Branch-Site), verify that outbound PSTN calls route successfully through the local SBC (sbc-mumbai.contoso.com).
  2. When the same user travels abroad or connects from an unmapped public Wi-Fi network, attempt an outbound PSTN call. Teams recognizes that the user is outside their permitted LBR network site and blocks the call, preventing illegal toll breakout across foreign gateways.

By leveraging PowerShell’s *-CsTeamsLocationBasedRoutingPolicy cmdlets alongside network site management, telecommunications engineers maintain complete compliance with national telecom regulations, preventing toll bypass and ensuring disciplined voice delivery across global Microsoft Teams deployments.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.