VoIP:Teams:Dismantle: Difference between revisions
From VTX Public Wiki
(Change title section level + name) |
(→Or Delete Voice Routing manually in Powershell Command Prompt: Remove -Username) |
||
Line 28: | Line 28: | ||
# Set Variables |
# Set Variables |
||
$MSTeamsDomain = '''"123456.teams.ipvoip.ch"''' |
$MSTeamsDomain = '''"123456.teams.ipvoip.ch"''' |
||
$MSteamsAdminUser = '''"admin@COMPANY.onmicrosoft.com"''' |
|||
# Connect to Microsoft Teams management and create all Voice Routing |
# Connect to Microsoft Teams management and create all Voice Routing |
||
$Session = New-CsOnlineSession |
$Session = New-CsOnlineSession |
||
Import-PSSession $Session -AllowClobber |
Import-PSSession $Session -AllowClobber |
||
Revision as of 12:19, 24 November 2020
Delete Voice Routing[edit | edit source]
Delete Voice Routing using a VTX Powershell Script VTX_Teams_Delete_Routing_Rules.ps1[edit | edit source]
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 |
To delete the Voice Routing Rule, the script will need to make sure no more user is still using it, and will try to unmap numbers and VoiceRoutingPolicy of users using the MSTeamsDomain that you are dismantling |
- Download https://wiki.vtx.ch/media/VTX_Teams_Delete_Routing_Rules.ps1 on your computer ( Right Click on the link / Download )
- 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
- VTX Teams Domain : ex: 123456.teams.ipvoip.ch
- Your MS Teams Admin Credentials : ex: admin@COMPANY.onmicrosoft.com
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
You will only be able to delete these entries if no user is using the CsOnlineVoiceRoutingPolicy |
- Open a powershell prompt on your PC
- Copy paste command below one by one changing the values in bold with your own
# Set Variables $MSTeamsDomain = "123456.teams.ipvoip.ch" # Connect to Microsoft Teams management and create all Voice Routing $Session = New-CsOnlineSession Import-PSSession $Session -AllowClobber # Delete the Voice Routing Remove-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$MSTeamsDomain" Remove-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain" Set-CsOnlinePstnUsage -Identity Global -Usage @{Remove="CsOnlinePstnUsage-$MSTeamsDomain"} # Logout Get-PSSession | Remove-PSSession