How to Configure Teams Phone Caller ID Policies in PowerShell Using CsTeamsCallingLineIdentity

In enterprise telecommunications and contact centre management, controlling how caller identification (Caller ID / CLI) is presented to external Public Switched Telephone Network (PSTN) recipients is essential for brand consistency, employee privacy, and regulatory compliance. Organizations frequently require individual users—such as sales representatives, customer support staff, or executives—to present a corporate main line or Auto Attendant phone number rather than their direct inward dialing (DID) number. Conversely, inbound PSTN spam or unsolicited telemarketing calls often require caller ID blocking or manipulation. In Microsoft Teams Phone System, administrators manage caller ID policies via the *-CsTeamsCallingLineIdentity cmdlets in PowerShell.

Understanding Microsoft Teams Caller ID Policy Architecture

Caller ID policies in Microsoft Teams govern how telephony signaling headers (including From, P-Asserted-Identity, and Privacy SIP headers) are populated during call setup:

  • CallingIDSubstitute: Defines what external telephone number is presented when a user initiates an outbound PSTN call:
    • LineURI: Presents the user’s directly assigned phone number (default behaviour).
    • Service: Substitutes the user’s caller ID with an assigned enterprise service number (such as an Auto Attendant or Call Queue DID).
    • Anonymous: Suppresses the outgoing telephone number completely, displaying “Private”, “Anonymous”, or “Blocked” on the recipient’s phone.
  • EnableUserOverride: Determines whether individual users can override administrative policy in their Teams desktop/mobile client settings to mask their caller ID on demand.
  • BlockIncomingPstnCallerID: Enables automatic blocking of inbound telephone calls where the calling party has suppressed their caller ID (anonymous callers).
  • ServiceNumber: The specific E.164 service telephone number configured as the outbound calling line identity.

Connecting to the Microsoft Teams PowerShell Module

Managing caller ID policies requires Teams Administrator or Global Administrator credentials in Microsoft 365. Open an elevated PowerShell session and connect:

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

# Connect to tenant
Connect-MicrosoftTeams

Inspecting Existing Calling Line Identity Policies

To view all caller ID policies established in your Microsoft 365 tenant, execute:

Get-CsTeamsCallingLineIdentity

To inspect detailed configuration properties for a specific policy:

Get-CsTeamsCallingLineIdentity -Identity "UK-Sales-CallerID" | Select-Object Identity, CallingIDSubstitute, ServiceNumber, EnableUserOverride, BlockIncomingPstnCallerID | Format-List

A typical active configuration output displays:

Identity                    : Tag:UK-Sales-CallerID
CallingIDSubstitute         : Service
ServiceNumber               : +442079460100
EnableUserOverride          : False
BlockIncomingPstnCallerID   : True

Creating New Caller ID Policies with New-CsTeamsCallingLineIdentity

To create a custom caller ID policy, use the New-CsTeamsCallingLineIdentity cmdlet.

Example 1: Masking Outbound Caller ID with a Corporate Service Number

The following command creates a policy that replaces employee direct numbers with the company’s primary customer service number (+44 20 7946 0100) and prevents end-users from altering this behaviour:

# Query available service telephone number
$ServicePhone = "+442079460100"

# Create policy substituting LineURI with service number
New-CsTeamsCallingLineIdentity -Identity "CustomerSupport-Outbound-CLI" `
  -Description "Masks user DIDs with main customer support number" `
  -CallingIDSubstitute Service `
  -ServiceNumber $ServicePhone `
  -EnableUserOverride $false

Example 2: Enforcing Complete Anonymous Outbound Calling

For sensitive roles (such as investigative units, crisis counsellors, or legal staff) that must never display telephone numbers externally:

New-CsTeamsCallingLineIdentity -Identity "Anonymous-Outbound-CLI" `
  -Description "Suppresses outbound caller ID completely" `
  -CallingIDSubstitute Anonymous `
  -EnableUserOverride $false

Example 3: Blocking Inbound Anonymous Spam Calls

To protect executive lines from unsolicited robocalls and spam originating from blocked caller IDs:

New-CsTeamsCallingLineIdentity -Identity "Executive-SpamShield-CLI" `
  -Description "Blocks inbound calls with anonymous caller ID" `
  -CallingIDSubstitute LineURI `
  -BlockIncomingPstnCallerID $true `
  -EnableUserOverride $true

Modifying Existing Policies with Set-CsTeamsCallingLineIdentity

If an enterprise replaces its primary customer support number or alters user override permissions, update the policy using Set-CsTeamsCallingLineIdentity:

# Update service number on existing policy
Set-CsTeamsCallingLineIdentity -Identity "CustomerSupport-Outbound-CLI" `
  -ServiceNumber "+442079460200" `
  -BlockIncomingPstnCallerID $true

Assigning Caller ID Policies to Users and Security Groups

Once created, caller ID policies must be assigned to individual users or mapped across groups using Microsoft Teams policy assignment cmdlets.

Assigning Policy to an Individual User

Grant-CsTeamsCallingLineIdentity -Identity "[email protected]" `
  -PolicyName "CustomerSupport-Outbound-CLI"

Assigning Policy to an Entire Security Group

To automate policy inheritance across hundreds of users using a Microsoft 365 or Entra ID Security Group:

# Query group object ID
$GroupId = (Get-AzureADGroup -SearchString "Support-Agents-Team").ObjectId

# Assign policy to group with priority rank
New-CsGroupPolicyAssignment -GroupId $GroupId `
  -PolicyType TeamsCallingLineIdentity `
  -PolicyName "CustomerSupport-Outbound-CLI" `
  -Rank 1

Removing a Caller ID Policy

When a policy is retired, first remove individual assignments, then delete the policy object using Remove-CsTeamsCallingLineIdentity:

Remove-CsTeamsCallingLineIdentity -Identity "Anonymous-Outbound-CLI" -Confirm:$false

By leveraging PowerShell’s CsTeamsCallingLineIdentity cmdlets, enterprise voice engineers enforce standardized corporate identities, protect employee personal privacy, and maintain regulatory compliance across Microsoft Teams Phone deployments.

Get the best tech tips delivered straight to your inbox.

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