Microsoft Teams Setup Guide (Condensed)

The first thing you need to do before anything else is to ensure that you have the appropriate 'Phone System Licenses' on your Office 365 account otherwise you will not be able to proceed with the voice integration. Please visit the FAQ link below to understand what your licensing requirements are to use Microsoft Teams for voice calling:

https://faq.hero.co.nz/index.php?action=artikel&cat=20&id=110&artlang=en-us

Pre-requisites - Before you Start

You will need the Skype for Business Powershell environment installed before you can run the Powershell commands later in the guide:

Follow the guides below for instructions on how to setup Skype for Business and Windows Powershell

Setup Guide: https://docs.microsoft.com/en-us/SkypeForBusiness/set-up-your-computer-for-windows-powershell/set-up-your-computer-for-windows-powershell
Overview: https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-overview

Install Link for Skype for Business Online, Windows PowerShell Module

https://www.microsoft.com/en-us/download/details.aspx?id=39366

Useful Guide for Installation of the Teams Environment

https://social.technet.microsoft.com/wiki/contents/articles/52052.microsoft-teams-administration-powershell-admin-center.aspx

Once these packages are installed and your Power Shell environment is ready you will need to do the following:

  1. Download and install SkypeOnlinePowerShell.exe from the following link if you have not done this already

    https://www.microsoft.com/en-us/download/details.aspx?id=39366

  2. Start Power Shell as Administrator (or with Administrator Priveleges)
  3. Run the following commands in Power Shell:

    Install-Module -Name MicrosoftTeams

  4. NuGet Provider is required to continue. Confirm by pressing 'Y'
  5. Untrusted Repository. Confirm by pressing 'A'



  6. Restart Power Shell and run as Administrator
  7. Change execution policy by typing the following command in Power Shell

    Set-ExecutionPolicy -ExecutionPolicy Unrestricted

  8. For the Execution Policy change confirm by pressing 'A'.  (Click here for additional information)



  9. Import the SkypeOnlineConnector Module

    Import-Module SkypeOnlineConnector

  10. If you want to test that your Power Shell is able to login and execute commands against your Office 365 account then run the following replacing commands:

    $userCredential = Get-Credential
    $sfbSession = New-CsOnlineSession -Credential $userCredential
    Import-PSSession $sfbSession

NOTE: If you receive an error connecting a session under your normal administrator account saying the remote name cannot be resolved (or similar error message) then you may need to use your 'onmicrosoft.com' administrator login details instead and use the following command to establish your session (replacing yourlogin.onmicrosoft.com below with your own login details)

Import-PSSession $(New-CSOnlineSession -OverrideAdminDomain "yourlogin.onmicrosoft.com") -AllowClobber

Step 1 - Go to the Admin Center page


Click here to go to the Microsoft 365 Admin Center page


Then click on 'Show All' and then 'Settings' and the Domains sub-menu option.



Step 2 - In another browser tab sign up for a Hero account by visiting hero.co.nz. If you already have an account skip to Step 6




Step 3 - Click on the Join link at the top of the Hero web site

Step 4 - Fill in your details and click on 'Sign Up'




Step 5 - You should receive a confirmation that your account is created. We will activate your account within 1 business day




Step 6 - Once activated Login to your Hero account by clicking here




Step 7 - In the Hero customer portal click on the Voice tab and then select 'Profiles' from the left side menu.


If you want to setup all lines on your account to use Microsoft Teams use the default profile otherwise you can create a new profile at the bottom of the page. In the drop down menu for Connection type select 'Microsoft Teams'.



Step 8 - Copy the Microsoft Teams Domain into your clipboard (it will be something like ms81xxxxxx.teams.hero.co.nz)




Step 9 - In the Domains page back in the Admin Center (under Settings/Domains) click 'Add domain'




Step 10 - Enter the Teams Domain you copied into your clipboard in Step 8 into the domain text box and click Next




Step 11 - Wait for the Verify Domain page to load (this can take some time and you may need to refresh the page)




Step 12 - The Verify domain page should now be displayed




Step 13 - Copy the TXT value by clicking the icon beside the TXT value information (e.g. MS=msxxxxxxxx)




Step 14 - Now switch back to the Hero customer portal page and paste this value into the Domain TXT record value field and then press 'Save Default Profile'




Step 15 - Now switch back to the Admin Center page and click on 'Verify'




Step 16 - You may need to wait 1 minute or retry if this fails. Be patient!



Step 17 - Once verified make sure all the options for online services are NOT ticked and click Next.




Step 18 - All being well this should complete and your Hero trunking domain will be added to your account.




Step 19 - Now switch to the 'Users' tab in the Admin Center and click 'Add a user'




Step 20 - We are going to create a 'temporary user' to associate with the Hero trunk domain



Step 21 - The user details should be something like 'Hero Trunk' and username of 'herotrunk'. Make sure you select our new Hero trunk domain from the drop down menu (e.g. msxxxxxxxx.teams.hero.co.nz). Then Click Next.




Step 22 - Now you need to assign a product license that includes phone services such as an E5 or E3 license to this user.




Step 23 - Leave the Role and Profile Info as default and click Next




Step 24 - Press 'Finish Adding'




Step 25 - You should receive confirmation the Trunk user has been created.




Step 26 - Go back to your Active users in the Users tab in Admin Center and the Trunk User should be listed.




Step 27 - Now switch back to your Hero customer portal tab and add any new numbers you want on teams. You can also port a number to Hero Teams or change an existing line type to be a Teams line in the Account/Numbers page.




Step 28 - For adding a new Teams number ensure you select the Line Type as 'Microsoft Teams' and select a Teams plan for the line. In this example we are adding a new user 'Joe Smith'




Step 29 - Continue to add numbers to your account as required. In this example the 2nd user is 'Fred Bloggs'




Step 30 - Finally for our example we add a 3rd user called 'Test User'




Step 31 - Click on 'Voice' tab and your Teams users should be listed with a 'Teams icon' beside them.


If you do not see any lines in the Teams page then it could be that you have not entered a valid TXT record in your Profile (see Step 14) or if you have created a new profile then you have not assigned that profile to your Teams lines in the Voice/Line Manager Page. Check the last column in the Line Manager page to check which profile the lines are assigned to and make sure this is the same profile that you have setup for Microsoft Teams



Step 32 - Now click on the 'Teams' page on the left menu



Fill in the fields against each teams number including the teams user IDs hosted in Office 365 (including the domain name e.g. Joe@herointernet.nz). You can also decide if you want to twin with a regular SIP phone or have the call failover to SIP or be hosted on Teams only. You can also decide if you want to use the Teams Voicemail system or the Hero voicemail and provide an 'offline forwarding number' for your users in case calls fail to Teams and you need to have a backup number for these users (e.g. their mobile phone number). Press 'Save Changes' when done.


Step 33 - The following steps are for Advanced users only who understand how to use the Microsoft Power Shell. Click on 'Power Shell' to display a list of commands you need to enter.




Step 34 - Open Microsoft Power Shell




Step 35 - Login a session to Power Shell using your main Teams Admin login which you usually use to Manage your Office 365 account which you use to login to your Teams Admin Center.


The format for this command is similar to the below commands:

$acctName="User@yourdomain.onmicrosoft.com"
$sfboSession = New-CsOnlineSession -UserName $acctName
Import-PSSession $sfboSession



Step 36 - Enter your Microsoft User Password




Step 37 - You should now be logged into a new session in the Power Shell and can start executing commands




Step 38 - Now start pasting the commands from Step 33 presented in the Hero Portal. The first command adds the first user to the trunk and this needs to be done BEFORE creating the Voice Route and Policy and will look something like:


Set-CsUser -identity "User@yourdomain.co.nz" -EnterpriseVoiceEnabled $true -HostedVoicemail $true -OnPremlineURI tel:+6492420001

Step 39 - Next paste the other tenant commands to setup the PSTN identity and Voice route details and then assign the calling and voice routing policy to your first user. This should look something like:


Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="HERO"}
New-CsOnlineVoiceRoute -Identity "HERO" -NumberPattern ".*" -OnlinePstnGatewayList "msxxxxxxxx.teams.hero.co.nz" -Priority 1 -OnlinePstnUsages "HERO"
New-CsOnlineVoiceRoutingPolicy -Identity "HERO" -OnlinePstnUsages "HERO"

Grant-CsTeamsCallingPolicy -PolicyName AllowCalling -Identity "User@yourdomain.co.nz"
Grant-CsOnlineVoiceRoutingPolicy -Identity "User@yourdomain.co.nz" -PolicyName "HERO"



Step 40 - Check your trunk status


If the commands above ran okay with no errors then you can check the status of your SBC trunk by visiting the Microsoft Teams Admin Portal - Direct Routing page at the following link:

https://admin.teams.microsoft.com/direct-routing/v2

Your trunk should show TLS Connectivity Status as 'Active' and SIP Options status as 'Active'. It can often take an hour or more for the trunk to become active, so please be patient. Once the trunk is active you can delete the temporary trunk user you created to free up the phone system license for other users.

Now, if you have more than just 1 user you can paste the Set-CsUser and Grant commands to associate of them them with a phone number and profile. The commands for each user will look something like:

Set-CsUser -identity "User@yourdomain.co.nz" -EnterpriseVoiceEnabled $true -HostedVoicemail $true -OnPremlineURI tel:+6492420001
Grant-CsTeamsCallingPolicy -PolicyName AllowCalling -Identity "User@yourdomain.co.nz"
Grant-CsOnlineVoiceRoutingPolicy -Identity "User@yourdomain.co.nz" -PolicyName "HERO"



Step 41 - Now go back to the Active Users page in the 'Admin Center' and if required set a password for your users otherwise move to Step 46




Step 42 - To set a password for your users select a user and click on Reset Password




Step 43 - Select 'Let me create the password' and enter a new password (in this example for Joe)




Step 44 - Click the Reset button to reset the password



Step 45 - Once you have confirmation that the password has been reset you are ready to login to Teams




Step 46 - Download the Teams client for your PC, Mac or Smartphone and login using your User ID (e.g. Joe@herointernetnz.nz)




Step 47 - Enter your Teams password to login




Step 48 - Click on the 'Calls' option on the left menu




Step 49 - If everything has worked to this point then you should see your phone number displayed and you will be able to make an outgoing call from Teams




Step 50 - Try a test call to any phone number to test this is working




Step 51 - You can now delete the 'Temporary User' we setup in Step 20 to connect the Hero Trunk as this is no longer required. Select it in your Active Users page in Admin Center




Step 52 - Confirm Deletion of the Hero Trunk user




Step 53 - You should receive confirmation that your Trunk user is now deleted




Step 54 - Incoming calls may take 15+ minutes to start working into your numbers as this delay is in Microsoft's provisioning. You can check the status of your trunk by going into the Teams menu in Admin Center and clicking on Teams




Step 55 - Next Click on the sub-menu option 'Direct Routing'




Step 56 - Once your trunk is ready you should see 'Active' in the TLS Connectivity and SIP OPTIONS columns




Step 57 - Repeat the process for all of your users and you are now setup with Hero's Teams integration and can receive calls in Microsoft Teams!