Manual Microsoft Teams Integration

Manual Microsoft Teams Integration

Teams configuration – PowerShell 

Usage of PowerShell is optional to configure users and to correctly add the direct routing. 

If you wish to perform the operations manually, please follow the guide.

Prerequisite

Ensure the following PowerShell module is installed before proceeding:

  • Teams PowerShell Overview 

Install-Module -Name MicrosoftTeams 

Ensure that you have Global Admin access right, else some commands might appear undefined, you won’t get an access denied error. If you are a Microsoft reseller you will usually have Global Admin rights on your tenants. 

Obtain the tenant ID of the account you are trying to configure, either through Microsoft administration panel or by using whatismytenantid.com 

Powershell Commands

*** Before beginning, note that any word in red must be changed to reflect your own parameters.

In PowerShell, run the following commands: 

  • This allows execution of necessary configuration scripts from Microsoft. It only needs to be executed the first time.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

  • Import the Microsoft Teams Module.

Import-Module MicrosoftTeams

 

  • Login and set the $credential variable

 

$credential = Get-Credential "admin@domain.com"

  • Create a new online session with your user.

$sfboSession = New-CsOnlineSession -UserName "admin@domain.com"

*** Optional: If you are managing another customer, you can override their account

$sfboSession = New-CsOnlineSession -UserName "admin@domain.com" -OverrideAdminDomain "clientmaindomain.com"

  • Import your Online Session and Microsoft Teams module.

Import-PSSession $sfboSession

  • Create the new Gateway route

*** main should be replaced by the PSTN name you set earlier in the admin panel.
*** customerdomain.teams.omnivigil.net should be replaced by the domain provided by Omnivigil which was activated earlier in Microsoft.

New-CsOnlineVoiceRoute -Identity Route1 -OnlinePstnUsages @{add="main"} -NumberPattern "^(.*)$" -OnlinePstnGatewayList @{add="customerdomain.teams.omnivigil.net"}

If the New-CsOnlineVoiceRoute command complains about missing gateway

Ensure that a user in Office is assigned to that domain 
The domain activation can take up to 24 hours
Create a new user, assign it to the domain and make sure the proper licenses are configured

  • Disable Microsoft Teams music on hold

If this feature is not disabled, any custom music on hold created at Omnivigil will not work.

Set-CsTeamsCallingPolicy -MusicOnHoldEnabledType Disabled

  • Enable Enterprise Voice and create an extension for a user:

*** user@domain must be the same user configured in the Omnivigil Portal.
*** extension is the same extension number the user uses in the Omnivigil Portal.
*** This must be run per user in order to activate and assign an extension to that user.

Set-CsUser -Identity "user@domain.com" -EnterpriseVoiceEnabled $true -OnPremLineURI "tel:+extension"