VoIP:Teams:Microsoft Management: Difference between revisions

From VTX Public Wiki

(Move section in subpage)
 
(Keep section common)
Line 8: Line 8:
*'''User Management URL''': https://admin.microsoft.com/Adminportal/Home#/users
*'''User Management URL''': https://admin.microsoft.com/Adminportal/Home#/users
* '''License Management URL''' : https://businessstore.microsoft.com/en-us/embed/admin/store/purchase-services
* '''License Management URL''' : https://businessstore.microsoft.com/en-us/embed/admin/store/purchase-services
** Buy '''Microsoft 365 Phone System''' => https://businessstore.microsoft.com/en-us/embed/admin/store/purchase-services;offerTab=Commercial/collections/Add-ons




== Voice Routing : Create Voice Routing to allow your users to use VTX Teams Connect ==
== Voice Routing : Create Voice Routing to allow your users to use VTX Trunk ==




{{Notice|1=You will only need to do voice routing setup once for all users}}
{{Notice|1=You will only need to do voice routing setup once for all users}}
{{Warning|1=It will take several hours for Microsoft to create your domain after linking it in the Kiosk, so it is wise to wait a few hours before trying to create the routing. If it is not ready, you won't be able to login or Voice Routing will not work. So you will need to be really patient.}}
{{Warning|1=It will take several hours for Microsoft to create your domain after linking it in the Kiosk, so it is wise to wait a few hours before trying to create the routing. If it is not ready, you won't be able to login or Voice Routing will not work. So you will need to be really patient.}}
{{Warning|1=If the script displays a red error on New-CsOnlineVoiceRoutingPolicy, please read [[VoIP:VTX_Teams_Connect#New-CsOnlineVoiceRoutingPolicy_-_Cannot_find_specified_Online_PSTN_usage]]}}
{{Warning|1=If the script displays a red error on New-CsOnlineVoiceRoutingPolicy, please read [[VoIP:Teams:Debug#New-CsOnlineVoiceRoutingPolicy_-_Cannot_find_specified_Online_PSTN_usage]]}}
{{Notice|1=Once Voice Routing has been correctly created without error, you can delete the user enableteams@<servicenumber>.teams.ipvoip.ch to free up its licenses, it is not needed anymore}}
{{Notice|1=Once Voice Routing has been correctly created without error, you can delete the user enableteams@<servicenumber>.teams.ipvoip.ch to free up its licenses, it is not needed anymore}}


Line 31: Line 30:




=== Create Voice Routing using a VTX Powershell Script VTX_Connect_Teams_Create_Routing_Rules.ps1 ===
=== Create Voice Routing using a VTX Powershell Script VTX_Teams_Create_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 37: Line 36:




# Download https://wiki.vtx.ch/media/VTX_Connect_Teams_Create_Routing_Rules.ps1 on your computer ( Right Click on the link / Download )
# Download https://wiki.vtx.ch/media/VTX_Teams_Create_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 )
# 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 create the routing
# Execute it on your PC : It will ask you for these parameters and create the routing
## VTX Teams Connect Domain : ex: 123456.teams.ipvoip.ch
## 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


Line 78: Line 77:




=== Assign numbers using a VTX Powershell Script VTX_Connect_Teams_Assign_Numbers.ps1 ===
=== Assign numbers using a VTX Powershell Script VTX_Teams_Assign_Numbers.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}}


# Download https://wiki.vtx.ch/media/VTX_Connect_Teams_Assign_Numbers.ps1 on your computer ( Right Click on the link / Download )
# Download https://wiki.vtx.ch/media/VTX_Teams_Assign_Numbers.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 )
# 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 create the routing
# Execute it on your PC : It will ask you for these parameters and create the routing
## VTX Teams Connect Domain : ex: 123456.teams.ipvoip.ch
## VTX Teams Domain : ex: 123456.teams.ipvoip.ch
## Your MS Admin Credentials for : ex: admin@MSDOMAIN.onmicrosoft.com
## Your MS Admin Credentials for : ex: admin@MSDOMAIN.onmicrosoft.com
## The MS Team user email : ex: first.last@MSDOMAIN.onmicrosoft.com
## The MS Team user email : ex: first.last@MSDOMAIN.onmicrosoft.com

Revision as of 14:36, 21 August 2020

Connect to Microsoft 365 Admin Portal[edit | edit source]


Voice Routing : Create Voice Routing to allow your users to use VTX Trunk[edit | edit source]

Now you will need to setup a routing plan. You can use one of the following options to do it

  • Using a Powershell Script that will ask you questions
  • Manually in Powershell


Microsoft Admin Center - Up to 24h Latency for each setup


Create Voice Routing using a VTX Powershell Script VTX_Teams_Create_Routing_Rules.ps1[edit | edit source]


  1. Download https://wiki.vtx.ch/media/VTX_Teams_Create_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 create the routing
    1. VTX Teams Domain : ex: 123456.teams.ipvoip.ch
    2. Your MS Teams Admin Credentials : ex: admin@COMPANY.onmicrosoft.com

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


  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
$MSTeamsDomain = "123456.teams.ipvoip.ch"
$MSteamsAdminUser = "admin@COMPANY.onmicrosoft.com"
# Connect to Microsoft Teams management and create all Voice Routing
$Session = New-CsOnlineSession -UserName $MSteamsAdminUser
Import-PSSession $Session -AllowClobber
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="CsOnlinePstnUsage-$MSTeamsDomain"}
New-CsOnlineVoiceRoute -Identity "CsOnlineVoiceRoute-$MSTeamsDomain" -Priority 0 -NumberPattern '.*' -OnlinePstnGatewayList "$MSTeamsDomain" -OnlinePstnUsages "CsOnlinePstnUsage-$MSTeamsDomain"
New-CsOnlineVoiceRoutingPolicy -Identity "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain" -OnlinePstnUsages "CsOnlinePstnUsage-$MSTeamsDomain"
Set-CsCallingLineIdentity -Identity Global -EnableUserOverride $True

# Verify all setup ( You can compare it with the Debug Section in the wiki ) 
Get-CsOnlinePstnUsage
Get-CsOnlineVoiceRoute
Get-CsOnlineVoiceRoutingPolicy
Get-CsCallingLineIdentity

# Logout
Get-PSSession | Remove-PSSession

Number Mapping : Assign numbers to Microsoft accounts[edit | edit source]

Now you will need to assign a number and a routing plan to each user with a "Microsoft 365 Phone System" license. You can use one of the following options to do it

  • Using a Powershell Script that will ask you questions
  • Manually in Powershell


Assign numbers using a VTX Powershell Script VTX_Teams_Assign_Numbers.ps1[edit | edit source]

  1. Download https://wiki.vtx.ch/media/VTX_Teams_Assign_Numbers.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 create the routing
    1. VTX Teams Domain : ex: 123456.teams.ipvoip.ch
    2. Your MS Admin Credentials for : ex: admin@MSDOMAIN.onmicrosoft.com
    3. The MS Team user email : ex: first.last@MSDOMAIN.onmicrosoft.com
    4. The Telephone number you wish to set : ex: +41225661234


Or Assign numbers manually in Powershell Command Prompt[edit | edit source]

  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
$MSTeamsDomain = "123456.teams.ipvoip.ch"
$MSteamsAdminUser = "admin@MSDOMAIN.onmicrosoft.com"
$MSTeamsUserEmail = "first.last@MSDOMAIN.onmicrosoft.com"
$MSTeamsUserNumber = "+41215661234"
# Connect to Microsoft Teams management and assign number and profile to the user
$Session = New-CsOnlineSession -UserName $MSteamsAdminUser
Import-PSSession $Session -AllowClobber
# Assign a number to your user and the Call Routing
Get-CsOnlineUser -Identity $MSTeamsUserEmail | Set-CsUser -EnterpriseVoiceEnabled $true -OnPremLineURI "tel:$MSTeamsUserNumber"
Get-CsOnlineUser -Identity $MSTeamsUserEmail | Grant-CsOnlineVoiceRoutingPolicy -PolicyName "CsOnlineVoiceRoutingPolicy-$MSTeamsDomain"
# Verify your setup 
Get-CsOnlineUser -Identity $MSTeamsUserEmail | Select EnterpriseVoiceEnabled,OnPremLineURI,OnlineVoiceRoutingPolicy,RegistrarPool | Format-List
# List all users with EnterPrise Voice Enabled
Get-CsOnlineUser ` -Filter {(enterprisevoiceenabled -eq $true) -and(HostingProvider -eq "sipfed.online.lync.com")} ` | Select sipaddress,HostedVoicemailPolicy,OnlineVoiceRoutingPolicy,lineuri,OnPremLineURI,RegistrarPool | Format-List
# Logout
Get-PSSession | Remove-PSSession