Commands › Microsoft Teams

Remove-CsOnlinePSTNGateway

Microsoft Teams MicrosoftTeams Remove-*

Removes the configuration of the previously defined Session Border Controller(s) (SBC(s)) that describes the settings for the peer entity. This cmdlet was introduced with Microsoft Phone System Direct Routing.

Quick start script

# Remove-CsOnlinePSTNGateway — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-CsOnlinePSTNGateway
$before | Format-List

# 3. Make the change (dry run first)
Remove-CsOnlinePSTNGateway -Identity <String> -WhatIf
Remove-CsOnlinePSTNGateway -Identity <String>

# 4. Verify and diff
$after = Get-CsOnlinePSTNGateway
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Remove-CsOnlinePSTNGateway [-Identity] <string> [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters (1)

ParameterTypeRequiredWhat it controls
-Identity String yes The parameter is mandatory for the cmdlet. The Identity is the same as the SBC FQDN.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.