In enterprise telecommunications and Microsoft Teams Phone deployments, protecting employees, call queues, and auto attendants from fraudulent robocalls, unsolicited telemarketing, and abusive external callers is a top operational priority. While administrators can configure regular expression patterns to block entire number ranges across the tenant, organizations frequently encounter specific, persistent phone numbers that must be blocked immediately without affecting broader dialing codes.
The Microsoft Teams PowerShell module includes dedicated cmdlets for managing granular inbound call blocking: CsTeamsPstnBlockedUsers. Using these cmdlets, administrators can query the global blocked callers list, add specific malicious numbers with descriptive administrative notes, and remove numbers when disputes or verification issues are resolved.
Understanding PSTN Call Blocking Architecture in Microsoft Teams
Microsoft Teams provides multiple layers of defense against unwanted Public Switched Telephone Network (PSTN) calls:
- Inbound Blocked Number Patterns (
CsInboundBlockedNumberPattern): Uses regular expressions (regex) to block or exempt broad patterns of numbers (for example, blocking specific area codes or international prefixes). - Blocked Callers List (
CsTeamsPstnBlockedUsers): Maintains a tenant-wide repository of specific, individual telephone numbers that are immediately rejected by Microsoft Teams Phone infrastructure before ringing any endpoint. - User-Level Call Blocking: Allows individual users to block numbers directly within their Teams desktop or mobile client interface, stored within their personal mailbox settings.
When an external PSTN call reaches the Teams Phone service (whether routed through Microsoft Calling Plans, Direct Routing, or Operator Connect), the calling number (Caller ID / ANI) is evaluated against the blocked list. If a match is found, the call is dropped immediately with an appropriate SIP disconnect code (such as 403 Forbidden or 603 Decline), consuming zero user attention or call queue capacity.
Connecting to the Microsoft Teams PowerShell Module
To administer PSTN call blocking rules, launch an elevated PowerShell console and connect to your Microsoft 365 tenant:
# Import the Teams PowerShell module
Import-Module MicrosoftTeams
# Connect to the Microsoft Teams tenant
Connect-MicrosoftTeams
Querying the Current List of Blocked PSTN Callers
To audit all currently blocked numbers in your organization, execute Get-CsTeamsPstnBlockedUsers:
# Retrieve all blocked telephone numbers
Get-CsTeamsPstnBlockedUsers
To display the output in a clean, structured table including the phone number, administrative notes, and internal GUIDs:
# Format blocked users list into a readable table
Get-CsTeamsPstnBlockedUsers | Format-Table Id, TelephoneNumber, Description
If no custom entries exist, the cmdlet returns an empty list, indicating that only automated carrier spam filtering is currently filtering inbound calls.
Adding Malicious Phone Numbers to the Block List
To block a specific nuisance or harassing telephone number, execute New-CsTeamsPstnBlockedUsers. The phone number must be formatted according to the international E.164 standard (beginning with a + sign followed by the country code and subscriber number):
# Block an individual malicious phone number
New-CsTeamsPstnBlockedUsers `
-TelephoneNumber "+12065550199" `
-Description "Aggressive robocall scam targeting accounts payable"
You can add international numbers across any jurisdiction using the same format:
# Block unwanted international sales spam
New-CsTeamsPstnBlockedUsers `
-TelephoneNumber "+442079460123" `
-Description "Unsolicited sales bot calling helpdesk queues"
The cmdlet validates the E.164 number format and adds the entry to the Microsoft Teams cloud Location and Routing infrastructure within minutes.
Updating Descriptions on Existing Blocked Entries
If an existing blocked record requires an updated ticket reference, case number, or reason description, use Set-CsTeamsPstnBlockedUsers targeting the specific entry ID:
# Update description for an existing blocked number entry
Set-CsTeamsPstnBlockedUsers `
-Id "a1b2c3d4-e5f6-7890-abcd-ef1234567890" `
-Description "Confirmed phishing campaign - Security Incident SEC-8941"
Removing Numbers from the Blocked Callers List
When a phone number was blocked by mistake, a vendor changes ownership, or an investigation clears a previously flagged number, remove the entry using Remove-CsTeamsPstnBlockedUsers:
# Remove a number using its record GUID
Remove-CsTeamsPstnBlockedUsers -Id "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
To remove a number by looking up its telephone number dynamically in automated cleanup scripts:
# Look up and remove a specific phone number
$entry = Get-CsTeamsPstnBlockedUsers | Where-Object { $_.TelephoneNumber -eq "+12065550199" }
if ($entry) {
Remove-CsTeamsPstnBlockedUsers -Id $entry.Id -Confirm:$false
Write-Host "Successfully unblocked $($entry.TelephoneNumber)"
}
By using CsTeamsPstnBlockedUsers to centrally enforce telephone number blocking, enterprise voice administrators protect organizational bandwidth, enhance employee security, and ensure seamless communication across Microsoft Teams Phone.