Ora

How do you block numbers on teams admin?

Published in Teams Call Blocking 4 mins read

To block numbers on Teams Admin, you primarily utilize Teams PowerShell cmdlets to manage the global blocked and exempt number lists for your tenant. This method allows you to control inbound call blocking at an organizational level.

How to Block Numbers on Teams Admin

Managing inbound call blocking in Microsoft Teams at an administrative level is performed using specific PowerShell commands. This allows for a global approach to prevent unwanted calls from reaching your users. The feature enables you to define patterns for numbers that should be blocked and also patterns for numbers that should be exempt from blocking, ensuring flexibility and control over your organization's call flow.

Utilizing Teams PowerShell for Global Call Blocking

The core of managing global blocked numbers in Teams Admin relies on the Teams PowerShell Module. You'll use specific cmdlets to view and modify these lists.

1. Connect to Teams PowerShell

Before you can block numbers, you need to establish a connection to the Microsoft Teams PowerShell module.

  • Install the Module (if not already installed):
    Install-Module -Name MicrosoftTeams -AllowClobber
  • Connect to Teams:
    Connect-MicrosoftTeams

    You will be prompted to sign in with your Microsoft 365 administrator credentials.

2. View Current Blocked and Exempt Numbers

To see any existing inbound blocked or exempt number patterns configured for your tenant, use the Get-CsTenantBlockedCallingNumbers cmdlet. This command returns the current inbound block number patterns and inbound exempt number patterns.

  • Command:
    Get-CsTenantBlockedCallingNumbers
  • Example Output:
    BlockedNumbers          : {+18005550100, +1206555*, anonymous}
    ExemptNumbers           : {+18005550101}

3. Add or Modify Blocked and Exempt Number Patterns

To activate the call blocking feature and define your global blocked and exempt numbers, you use the Set-CsTenantBlockingCallingNumbers cmdlet. This cmdlet allows you to specify number patterns for both lists.

  • Understanding Number Patterns:

    • Exact Match: Enter the full phone number, e.g., +12065550123.
    • Wildcard Match: Use an asterisk (*) for partial number matches, e.g., +1206555* to block all numbers starting with +1206555.
    • Anonymous Calls: Use the keyword anonymous to block calls where the caller ID is withheld.
    • Regular Expressions: For more complex pattern matching, you can use regular expressions. Ensure they are properly formatted and escaped.
  • Adding Blocked Numbers:
    To add or update the list of blocked numbers, use the -BlockedNumbers parameter.

    Set-CsTenantBlockingCallingNumbers -BlockedNumbers @("+18005550100", "+1206555*", "anonymous")

    This command will overwrite any existing blocked numbers with the new list you provide. To append, you'll first need to retrieve the existing list, add your new entries, and then set the combined list.

  • Adding Exempt Numbers:
    To add or update the list of exempt numbers (numbers that should never be blocked, even if they match a blocked pattern), use the -ExemptNumbers parameter.

    Set-CsTenantBlockingCallingNumbers -ExemptNumbers @("+18005550101", "+1425*")

    Similar to blocked numbers, this command will overwrite existing exempt numbers.

  • Combining Blocked and Exempt Numbers:
    You can update both lists in a single command:

    Set-CsTenantBlockingCallingNumbers -BlockedNumbers @("+18005550100", "+1206555*", "anonymous") -ExemptNumbers @("+18005550101", "+1425*")

4. Remove Blocked or Exempt Numbers

To remove specific numbers or patterns from either list, you'll need to retrieve the current list, remove the unwanted entry, and then update the list using Set-CsTenantBlockingCallingNumbers.

  • Example: Remove a specific blocked number:
    1. Get current list:
      $currentBlocked = (Get-CsTenantBlockedCallingNumbers).BlockedNumbers
    2. Filter out the number to remove:
      $updatedBlocked = $currentBlocked | Where-Object { $_ -ne "+18005550100" }
    3. Set the updated list:
      Set-CsTenantBlockingCallingNumbers -BlockedNumbers $updatedBlocked

Key Considerations and Best Practices

  • Global Impact: Numbers blocked using this method apply tenant-wide for inbound calls.
  • Specificity vs. Wildcards: Use specific numbers for precise blocking or wildcards for broader coverage. Be cautious with broad wildcard patterns to avoid inadvertently blocking legitimate calls.
  • Exemptions: Always ensure critical numbers (e.g., emergency services, internal support lines) are added to the exempt list if there's any chance they might be caught by a broad blocking pattern.
  • Testing: After making changes, test the blocking functionality by making calls from and to the affected numbers to ensure the desired outcome.
  • Documentation: Maintain clear documentation of the numbers and patterns you have blocked or exempted, along with the reasons for their inclusion.
  • Regular Review: Periodically review your blocked and exempt lists to ensure they remain relevant and effective.

Summary of Cmdlets

Cmdlet Description Parameters
Get-CsTenantBlockedCallingNumbers Displays the current global inbound block number patterns and inbound exempt number patterns. None
Set-CsTenantBlockingCallingNumbers Configures the global inbound block and exempt number lists for your Teams tenant. -BlockedNumbers <String[]>: An array of numbers or patterns to block.
-ExemptNumbers <String[]>: An array of numbers or patterns to exempt.

For detailed information on the Teams PowerShell module and its cmdlets, you can refer to the official Microsoft documentation: