VoIP:Teams:Dismantle: Difference between revisions

From VTX Public Wiki

(Now there is a script to delete voice routing)
(Add picture for dismantling)
 
(4 intermediate revisions by one other user not shown)
Line 2: Line 2:




=== Create Voice Routing using a VTX Powershell Script VTX_Teams_Create_Routing_Rules.ps1 ===
==== Delete Voice Routing using a VTX Powershell Script VTX_Teams_Delete_Routing_Rules.ps1 ====


{{Warning|1=By default for security reason, it is not allowed to execute a powershell script downloaded on the internet, that is why you will need to open them with Wordpad to check what it does, save it and execute it afterwards}}
{{Warning|1=By default for security reason, it is not allowed to execute a powershell script downloaded on the internet, that is why you will need to open them with Wordpad to check what it does, save it and execute it afterwards}}
Line 12: Line 12:
# Open it with Wordpad and use Ctrl-s to save it again ( to inform the system that it is local script )
# Open it with Wordpad and use Ctrl-s to save it again ( to inform the system that it is local script )
# Execute it on your PC : It will ask you for these parameters and delete the routing
# Execute it on your PC : It will ask you for these parameters and delete the routing
## VTX Teams Domain : ex: 123456.teams.ipvoip.ch
## Your MS Teams Admin Credentials : ex: admin@COMPANY.onmicrosoft.com
## Your MS Teams Admin Credentials : ex: admin@COMPANY.onmicrosoft.com
## VTX Teams Domain : ex: 123456.teams.ipvoip.ch
# If you have several other Teams trunk on your company, do not execute the last option that would delete the Dial Plan rules
[[File:Teams-Connect-Dismantling-Routing-01a.png|none|thumb|900x900px]]






=== Or Delete Voice Routing manually in Powershell Command Prompt ===
==== Or Delete Voice Routing manually in Powershell Command Prompt ====
Here are the commands you can use to delete the Voice Routing if you wish to migrate service somewhere else
Here are the commands you can use to delete the Voice Routing if you wish to migrate service somewhere else


Line 27: Line 29:


# Set Variables
# Set Variables
$MSTeamsDomain = '''"123456.teams.ipvoip.ch"'''
$TeamsDomain = '''"123456.teams.ipvoip.ch"'''
# Connect to Microsoft Teams management
$MSteamsAdminUser = '''"admin@COMPANY.onmicrosoft.com"'''
Connect-MicrosoftTeams
# Connect to Microsoft Teams management and create all Voice Routing
$Session = New-CsOnlineSession -UserName $MSteamsAdminUser
Import-PSSession $Session -AllowClobber
# Delete the Voice Routing
# Delete the Voice Routing
Remove-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$MSTeamsDomain"
Remove-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$TeamsDomain"
Remove-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain"
Remove-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$TeamsDomain"
Set-CsOnlinePstnUsage -Identity Global -Usage @{Remove="CsOnlinePstnUsage-$MSTeamsDomain"}
Set-CsOnlinePstnUsage -Identity Global -Usage @{Remove="CsOnlinePstnUsage-$TeamsDomain"}
# Delete Voice Dial Plan. Only do this if they are not used by another domain

Set-CsTenantDialPlan -Identity "Global" -NormalizationRules @()
# Logout
# Logout
Disconnect-MicrosoftTeams
Get-PSSession | Remove-PSSession

Latest revision as of 08:14, 21 January 2026

Delete Voice Routing[edit | edit source]

Delete Voice Routing using a VTX Powershell Script VTX_Teams_Delete_Routing_Rules.ps1[edit | edit source]


  1. Download https://wiki.vtx.ch/media/VTX_Teams_Delete_Routing_Rules.ps1 on your computer ( Right Click on the link / Download )
  2. Open it with Wordpad and use Ctrl-s to save it again ( to inform the system that it is local script )
  3. Execute it on your PC : It will ask you for these parameters and delete the routing
    1. Your MS Teams Admin Credentials : ex: admin@COMPANY.onmicrosoft.com
    2. VTX Teams Domain : ex: 123456.teams.ipvoip.ch
  4. If you have several other Teams trunk on your company, do not execute the last option that would delete the Dial Plan rules
Teams-Connect-Dismantling-Routing-01a.png


Or Delete Voice Routing manually in Powershell Command Prompt[edit | edit source]

Here are the commands you can use to delete the Voice Routing if you wish to migrate service somewhere else


  1. Open a powershell prompt on your PC
  2. Copy paste command below one by one changing the values in bold with your own
# Set Variables
$TeamsDomain = "123456.teams.ipvoip.ch"
# Connect to Microsoft Teams management
Connect-MicrosoftTeams

# Delete the Voice Routing
Remove-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$TeamsDomain"
Remove-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$TeamsDomain"
Set-CsOnlinePstnUsage -Identity Global -Usage @{Remove="CsOnlinePstnUsage-$TeamsDomain"}
# Delete Voice Dial Plan. Only do this if they are not used by another domain
Set-CsTenantDialPlan -Identity "Global" -NormalizationRules @()

# Logout
Disconnect-MicrosoftTeams