Set the custom Focusing status in Microsoft Teams using Power Automate

I am a Pomodoro Technique enthusiast. During a Pomodoro sprint it is important to mute distractions. This worked fine with custom presence states in Skype for Business, which is one of my most popular blog posts to date, on a daily basis. With Microsoft Teams, this has been a challenge, until now.

The Focusing custom Teams status can only be set by MyAnalytics via a calendar event called ‘Focus time‘. I have not been able to recreate this calendar event type manually, so it must be something in the header. During a ‘Focus time calendar event, the Teams client sets the status to Do Not Disturb with a custom name called Focusing. I don’t like the current way MyAnalytics schedules this event since it is two hours long and weeks in advance. I need a way to set this status at the time I am focusing, to mute distractions and tell my peers that I am in a focus, deep work, flow Pomodoro sprint.

The result using my Pomodor PowerShell timer

The Teams Focusing status fits well with the PowerShell Pomodoro Timer. As you see, it may take up to 3 minutes for the status to update, but I take what I can get :)

How I solved it

I trigger a Power Automate flow using a HTTP request trigger using Invoke-WebRequest in PowerShell. The flow takes two inputs, duration and a secret. If the secret is correct, to make sure the flow can’t be easily hacked, it gets my calendar and searches for calendar event with subject ‘Focus time’. It takes the first entry and changes start time and stop time for the event using the duration I have set, usually 25 minutes. Now I have a ‘Focus time’ calendar event that is set at the same time as my Pomodoro sprint with the same duration. After 1-3 minutes, my status will be updated to Focusing. After 25 minutes, plus 1-3 minutes, my status will be reset. BOOM, how cool is that!?

Prerequisites

  • Calendar must be in Exchange Online
  • You must have MyAnalytics as part of your license and enabled
    • Schedule 1 period with MyAnalytics to get the calendar event
    • Available in Enterprise SKU’s
  • You must have Power Automate license and ability to use Premium triggers
    • The trigger used is HTTP request and is a Premium trigger
    • You may find that you can use other free triggers as well
    • Premium triggers are included in Dynamics 365 SKU’s
    • Premium triggers are not included in Microsoft 365 SKU’s
    • The standalone $15 Per User plan can run Premium triggers
  • I would love to hear thoughts on how this can be done in a smarter way and if there are any free triggers that covers this scenario

Creating the calendar event and importing the Power Automate flow

  • Create the calendar event in MyAnalytics
  • Import the flow in your Power Automate
    • Download the RescheduleFocusTimeCalendarEvent.zip file here
    • Navigate to your personal Power Automate dashboard at https://flow.microsoft.com/
    • Go to My flows in the left menu and click Import
    • Click Upload and choose the zip file
    • To be able to complete the import you must click the wrench in the first line and choose Create as new under Setup
    • Next you must create the Outlook connector by clicking on the wrench in the second line for Related resources
      • Click Create new
      • Scroll down to Office 365 Outlook, click Create and authenticate as your user
      • Now you have created the Outlook connector, go back to the flow import website and select you new connector and Save
      • Import the flow by clicking Import
      • The import should be successful, navigate to My flows
    • Edit your new flow called RescheduleFocusTimeCalendarEvent
    • Now, let’s go through it and update the flow for your environment

Configuring the Power Automate flow

Click Edit on the flow and expand When a HTTP request is received and copy the HTTP POST URL and save it for later

Expand Condition and change MySecret to your own and take note of it

If no is there to trigger if the secret is wrong, it is a small security measure so that people not easily can steal you flow URL, but they also need the secret, or you can change it if it does get lost

Under If yes, expand Connections, click connect and delete the current guid, then you will be able to choose your calendar

Click advanced options in Get Events (V4) and validate that we are finding calendar events with subject ‘Focus time’ and we are getting the first entry. This means it does not matter how many events of ‘Focus time’ you have in your calendar. Expand Current time and Get future time. Future time is controlled by the duration variable we sent to the HTTP trigger.

Expand Apply to each and Update event (V4). Again, you need to choose your calendar. Id is the ‘Focus time’ calendar event, Subject is the same, Start time is our current time, End time is our future time and choose your timezone

That’s it! You are now ready to invoke your flow. In PowerShell you need to run the following code

[int]$Minutes = 25 #Duration of your Pomodoro Session, default is 25 minutes
[string]$Secret = "MySecret" #Secret for the flow trigger
[string]$AutomateURI = "YourFlowTriggerURI" #The URI used in the webrequest to your flow


#Invoking PowerAutomate to change set current time on your Focus time calendar event, default length is 25 minutes
    $body = @()
    $body = @"
        { 
            "Duration":$Minutes,
            "Secret":"$Secret"
        }
"@
Invoke-RestMethod -Method Post -Body $Body -Uri $AutomateURI -ContentType "application/json"

Go back to Power Automate and validate that the flow ran, check your Outlook calendar that the ‘Focus time’ event was moved to now and wait up to 3 minutes to see your status change. When the calendar time is over, your status will be reset and you are available again.

The practical approach with the Pomodoro PowerShell timer

With the ability to control the status in Teams, I believe the Pomodoro PowerShell timer is feature complete. One thing is to be unavailable and reduce distractions, but it is very important to automatically become available again. The reason for WHY you would use this kind of timer and automation is to avoid getting distracted which breaks your flow and deep work. Research shows that it takes between 7-30 minutes to get back in to flow after you have seen just one email or message. Here is what the script does

  • Starts presentation mode to block popups on your computer
  • Hides badges on taskbar so that you do not get distracted by seing that you have a new mail, task or chat
  • Opens you favorite flow and deep work Spotify playlist so that you do not spend time figuring out what to listen to
  • Uses IFTTT to mute your phone, works with Android and iOS
  • Finally set your status in Teams to Focusing
  • After the Pomodoro sprint is over, everything will be turned back on again

Below is a sample code to run the Start-SimplePmodoro.ps1 script which you can download from GitHub

Start-SimplePomodoro `
-SpotifyPlayList spotify:playlist:XXXXXXXXXXXXXXXXXX `
-IFTTTMuteTrigger pomodoro_start `
-IFTTTUnMuteTrigger pomodoro_stop `
-IFTTTWebhookKey XXXXXXXXX `
-Secret YourFlowSecret  `
-AutomateURI YourAutomateURI `

Why is it important to automatically become available?

You have been gone for 25 minutes, use the pause to check if anyone has been trying to reach you, re-prioritize your tasks, get more coffee and then dive in to a new Pomodoro sprint. After 25 minutes it is OK to get distracted, but if nothing happens, just stay in the flow you jump started and get stuff done. Download the Pomodoro PowerShell timer from GitHub

Discover all headsets used in #MicrosoftTeams PowerBI report

Part of succeeding with Microsoft Teams in the organization is to use certified for Microsoft Teams devices. I wrote about this in my article Why certified for Microsoft Teams devices are important. To succeed with this we need visibility and knowledge about what is being used in our environment.

I have created a simple PowerBI report for this. Download it here. The report will find which devices are used within your organization. The report uses the CQD connector for PowerBI and you can publish it and add it as a tab in Teams.

The report connects directly to the CQD database which is the only supported way. Because of this, the user who accesses the report in Teams needs one of the following admin roles assigned.

  • Global Administrator
  • Global Reader
  • Skype for Business Administrator
  • Teams Service Administrator
  • Teams Communications Administrator
  • Teams Communications Support Engineer
  • Teams Communications Support Specialist
  • Reports Reader

To just see the devices used without getting the UPNs of the users, you can use the Reports Reader or Teams Communications Support Specialist roles.

The report

By specifying the Second UPN you can see what kind of devices individuals in your organization are using. You will find that there are multiple entries of the same devices because Second Capture Dev name is different. There is currently no way of using regex to mitigate this. Second Capture Dev is the microphone used in the audio conversations and is an indication of device used regardless of PSTN, Teams call, or conference.

Default input device, Audio and Realtek High Definition Audio are typically indications of using jack based or laptop speakers as the mic. In the picture below you see that CloudWay are mostly using certified devices👍

The report is based on Audio Call Count and Second Capture Dev from the CQD database

Requirements

  • Download the CQD PowerBI reports created by Microsoft
    • Read more about them and get the reports here
  • Download and install PowerBI desktop
  • Download the GetDeviceReport from GitHub
  • Assign PowerBI PRO license, to be able to publish the report online
  • Assign at least Teams Communications Support Specialist admin role to be able to connect and read the CQD database

Setting up the report, publish it to PowerBI and adding it as a tab in Teams

  • Make sure you have or create the folder
    • [Documents]\Power BI Desktop\Custom Connectors
  • Copy the MicrosoftCallQuality.pqx to the above folder
    • This file is in the zip package you downloaded called CQD-Power-BI-query-templates.zip
    • This gives you the Microsoft Call Quality (Beta) connector in the PowerBI desktop app
  • To build a report and run queries, you will first need to connect to the CQD data source.
  • Follow the steps below to connect:
    • In the Home tab of Power BI Desktop, click on Get Data.
    • The Get Data window should appear at this point. Navigate to Online Services, then select Microsoft Call Quality (Beta) and hit Connect.
    • You will be prompted to log in
    • The next prompt will give you the option between two Data Connectivity modes.
      • Select DirectQuery, which is the only supported way to connect to CQD, and hit OK
    • Finally, you will be given a final prompt showing you the entire data model for CQD.
      • No data will be visible at this point, only the data model for CQD.
      • Select Load to complete the setup process.
    • At this point, Power BI will load the data model onto the right side of the window.
      • The page will remain otherwise blank, and no queries will be loaded by default.
      • Proceed to Building Queries below to build a query and return data.
    • Now you are ready to open the PowerBI report you downloaded from GitHub
      • Open GetDevice.pbix, see it load in PowerBI desktop
      • Next, we need to publish the report by clicking Publish in the top menu to the left
      • In the Publish to PowerBI window, you should see the Teams you are an owner of as workspaces
      • Choose one and click Select
    • When it is finished publishing you can go the Team, find a channel and add PowerBI report as a tab
      • In the workspace, you have published to, find the report and click Save
    • You have now imported one of the CQD PowerBI reports
    • Everyone that wants to see the report in Teams needs to have one of the admin roles mentioned previously
    • The report may take some time to load and this is because it is getting the data in real time. There is no supported way to pre-load the data at the moment

Need more Microsoft Teams insights like this? Check out the monthly updated book Office 365 for IT Pros where I write the calling and meetings chapter.

Updated my #Pomodoro #PowerShell timer

Ever been so busy you can’t get anything done? What do I do during those times? Spend time optimizing my productivity routine of course. June 2020 was super busy period for me and I found that my PowerShell Pomodoro timer needed some tuning to be easier to use. Download the updated script from GitHub. I have done the following changes

  • Hide Badges on taskbar buttons
  • Create a shortcut to start it in a fast and simple way
  • Fixed so that presentationsettings.exe works in 64bit PowerShell
  • Read my original post about this script
  • Pomodoro is a technique to induce flow in a busy workday through single tasking. Read more at the end of this blogpost

Hide badges on taskbar buttons

Instead of stopping Microsoft Teams, I hide the badges on taskbar buttons such as Outlook, Teams and Microsoft To Do. You must have access to changing the registry for this to work which was the best approach I could find.

#Hide badge or stop Teams
if ($Teamsmode -notmatch "HideBadge"){
    #Stop Microsoft Teams
    Write-Host "Closing Microsoft Teams" -ForegroundColor Green
    Get-Process -Name Teams -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
}
else{
    #Hiding badges on taskbar buttons such as Outlook, Teams and ToDo
    Write-Host "Hiding badges on taskbar buttons" -ForegroundColor Green
    Set-Itemproperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'TaskbarBadges' -value '0'
    Stop-Process -ProcessName explorer
}

During hide badge you will not see status in the taskbar icons, which helps you keep focus during the Pomodoro sprint.

When the Pomodoro sprint is finished, it will show badges again

Showing badge on taskbar app is new in Microsoft To Do and can be turned on or off under settings, I prefer to turn it off

Create a shortcut to start it in a fast and simple way

In order to start the script in an fast and simple way, you can create a shortcut to the script.

  1. On you desktop, right click and select new shortcut
  2. In the shortcut target box, type the following:
    • powershell.exe -noexit -ExecutionPolicy Bypass -File
  3. File is the path where you stored the Start-SimplePomodoro.ps1
    • “C:\Users\UserName\OneDrive – CloudWay\Dokumenter\GitHub\MyScripts\Start-SimplePomodoro\Start-MySimplePomodoro.ps1”
  4. I have crated an Icon you can use for the shortcut which you can find on GitHub
  5. If you pin it to you taskbar, you can easily start your Pomodoro sprint

Fixed so that presentationsettings.exe works in 64bit PowerShell

I use presentationsettings.exe to put the computer in presentation mode which supresses popups from all you applications and Windows 10. This is an 32bit application. I found that 64bit PowerShell could not find this due to the feature, File System Redirector. I found a workaround and incorporated it in the script so that it works wherever you are running it

Write-Host "Starting presentation mode" -ForegroundColor Green
if (Test-Path "C:\Windows\sysnative\PresentationSettings.exe"){Start-Process "C:\Windows\sysnative\PresentationSettings.exe" /start -NoNewWindow}
else {presentationsettings /start}

By pointing 64bit PowerShell to the path C:\Windows\sysnative\ I was able to run 32bit apps like PresentationSettings.

The result

Download the script from GitHub

The goal is to induce the flow state in a busy workday

Multitasking is a myth. The goal is to reach the flow state by focusing on one task at a time. Have you ever started writing an email, thought you sent it and eagerly waiting for a response, only to find it incomplete and unsent at the end of the day? This is one of the perils of multitasking.

The Pomodoro Technique is a great methodology to induce flow in a busy workday. It is all about avoiding distractions for 15-25 minutes and focus on one task at a time. This is a short enough period in the day that you can squeeze it in before a meeting. It is incredible what you can get done 15-25 minutes. The goal is to not get distracted and it takes about 7 minutes of focus before you reach your flow state.

If you want to succeed with Pomodoro, you need to make yourself unavailable. Equally important, you need to make yourself available again when those 25 minutes have passed. That is why we created the Pomodoro PowerShell tool, and why I love the simplicity of this approach.

Watch an outtake from my session at Microsoft Ignite 2017 on single-tasking

Learn more on my thinking around single-tasking and tools available to succeed with the flow state, from this outtake of my OneNote LifeHacks talk at Microsoft Ignite 2017

Happy deep work!

Why certified for #MicrosoftTeams devices are important

Part of succeeding with Microsoft Teams in the organization is to use certified for Microsoft Teams devices. There is a difference between consumer devices and business headsets. The major difference for headsets is noise cancelling in the microphone and cameras support the Teams video codec.

A consumer headset is prone to amplify the sounds around you, business headsets focus on your voice and work better in noisy environments. Most importantly, headsets certified for Microsoft Teams support wideband audio with the SILK codec used in all Teams clients, which means you sound better for your audience than with a consumer headset. All certified for Teams devices will be updated to support the new SATIN codec coming in Q2 2020.

Devices certified for Microsoft Teams are all listed and updated at https://aka.ms/TeamsDevices. Some of the advantages for the end-users are:

For an administrator the advantages are:

What about certified for Skype for Business devices?

They support the SILK codec too, so all good, but they may not have newer functionality like the Teams button found on certified for Teams devices. You can even use certified for Lync 2013 devices. Everything older than that is not OK, like Lync 2010 and OCS 2007 certified devices. Reason? No support for wideband SILK codec. Keep this in mind if you have upgraded from OCS and Lync to Skype for Business to Microsoft Teams.

It is common to find consumer devices in business environments, because the awareness of the the above features are low. But this is important, because if we have done all the network optimization and made sure users are adopting Teams, the last mile with a proper device is where we fail too often. Use my CQD PowerBI report to identify devices used in your environment and correlate the findings with devices listed at https://aka.ms/TeamsDevices.

Want a PRO headset for focus while working and travelling that is certified? Check out this unboxing and first impressions YouTube video. Watch the video to get my thoughts on the Bluetooth dongle that comes with the wireless headsets at 5:41

Need more Microsoft Teams insights like this? Check out the monthly updated book Office 365 for IT Pros where I write the calling and meetings chapter.

Did you know that you can control notifications from #MicrosoftTeams channel @mentions? 

Yep, it’s true, here is the scenario

  1. You are joined to a lot of teams with high activity and people are @mentioning the Teams and channels because internal emails are moved to Teams, which they should!
  2. Every day you get back to work, you have a huge amount of notifications to go through in your activity feed because people are @mentioning everything all the time to get attention
  3. You are starting to wonder if Teams is a fad and are longing back the thousands of unread internal email messages in Outlook instead

Here is the solution

  1. To avoid getting a notification when someone is @mentioning a channel
    • Go and unfavorite itUnfavorite
    • You still get a notification when someone @mentions your name
    • You cannot unfavorite the General channel, this is why it should be only used for off-topic discussions, wins or general announcements
    • Want to go the other way and get notified whenever someone is talking in a channel? Go and follow the channelFollow
  2. To avoid getting a notification when someone is @mentioning a team
    • There is no way to avoid getting a notification
    • This is why you should refrain from mentioning a team unless it is at the utmost importance
    • You can actually turn off that people can mention either a team or a channel as owner under Manage Team -> Settingsmentions

That’s it really. Now you know it is a huge difference in @mentioning a Team vs channel. #LifeHack

Post a #MicrosoftTeams channel chat message from #PowerShell using Graph API

Implementing Microsoft Teams is 10% IT, 10% governance and the rest is a cultural change. As part of the governance process, I have long seen the need to post the first chat message in a Team channel reminding the members of some cultural etiquette scenarios as part of a governance process. Up until now, December 2018, this was not possible unless you created an Incoming Webhook which required an administrator to log in to a Team which meant it was not something you could do during an automated creation.

Good news, you can now use the Graph API to post messages to channels without the webhook. This is still part of the beta API as of December 2018 and is not intended for production, yet. Here is what you need to do

Prerequisite: you need to create an Azure AD App registration with the correct permissions

  1. Log on to https://portal.azure.com with a GA administrator
  2. Navigate to Azure Active Directory
  3. go to App registration (Preview)
  4. Click + New registration
  5. Call it PowerShelltoTeamsGraphAPI
  6. Leave Redirect URI blank
  7. Go to Authentication and under Redirect URIs choose urn:ietf:wg:oauth:2.0:oob
  8. Click Save
  9. Go to API permissions to grant the required group read and write permissions
  10. Click + Add a permission
  11. Choose Microsoft Graph, Delegated permissions and choose Group.Read.All and ReadWrite.All (remember you need to expand Group)
  12. Click Grant admin Consent from  and click Yes
  13. You now have admin consent granted for your tenant
  14. Navigate to Overview
  15. Copy the Application (client) ID
  16. we are going to use it in the next step when logging on
  17. Check out the references pictures below

You are now ready to connect to the Graph API via PowerShell. The connection code is from a more thorough blog post by my MVP colleague Alexander Holmeset. $clientId is the client ID you copied in the prerequisites

#Connect Graph, use the client ID we created earlier in the lab called PowerShelltoTeamsGraphAPI in Azure AD under app registrations
#Source: https://alexholmeset.blog/2018/10/10/getting-started-with-graph-api-and-powershell/
$clientId = "bb808f16-b6ef-44aa-8218-2520aaff461e"
$redirectUri = "urn:ietf:wg:oauth:2.0:oob"
$resourceURI = "https://graph.microsoft.com"
$authority = "https://login.microsoftonline.com/common"
$AadModule = Import-Module -Name AzureADpreview -ErrorAction Stop -PassThru
$adal = Join-Path $AadModule.ModuleBase "Microsoft.IdentityModel.Clients.ActiveDirectory.dll"
$adalforms = Join-Path $AadModule.ModuleBase "Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll"
[System.Reflection.Assembly]::LoadFrom($adal) | Out-Null
[System.Reflection.Assembly]::LoadFrom($adalforms) | Out-Null
$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority
# Get token by prompting login window.
$platformParameters = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters" -ArgumentList "Always"
$authResult = $authContext.AcquireTokenAsync($resourceURI, $ClientID, $RedirectUri, $platformParameters)
$accessToken = $authResult.result.AccessToken

#Validate that you have access by getting a list of all Office 365 Groups in your tenant
$apiUrl = 'https://graph.microsoft.com/v1.0/Groups/'
$Data = Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken"} -Uri $apiUrl -Method Get
($Data | select-object Value).Value

Then you need to get the group ID and Id of the channel you want to post to. In this example, I use the Microsoft Teams PowerShell module and I want to post to a Team called TMDemo in the General channel. This can, of course, be done as part of a governance creation process

Connect-MicrosoftTeams

#I assume you only have one TMDemoXX Group
$TeamGroupID = (Get-Team | Where-Object {$_.displayname -match "TMDemo"}).GroupId
$TeamChannelID = (Get-TeamChannel -GroupId $TeamGroupID | Where-Object {$_.displayname -match "general"}).Id

Now you are ready to post to the channel, you are connected without errors, we have the Team you are posting to and have chosen a channel. There is one more thing, you also need to be a member of the Team in order to post. Make sure you get added, and then remove the admin user when you are finished posting. “content” is HTML text so you can format it nicely with bulletpoints and stuff.

#connect to teams channels and post a message
$apiUrl = "https://graph.microsoft.com/beta/teams/$TeamGroupID/channels/$TeamChannelID/chatThreads"
#add your admin user as member of the team
Add-TeamUser -User $UserName -GroupId $TeamGroupID
$body = @{
"rootMessage" = @{
    "body" = @{
        "contentType" = 1;
        "content" = '<h1>Welcome to this project. All project related discussions happen in the respective channels in our Team. We look forward to working with you and remember, General channel is used for announcements, wins and off-topic discussion</h1>'
        }
      }
}
$bodyJSON = $body | ConvertTo-Json
$Data = Invoke-RestMethod -Headers @{Authorization = "Bearer $accessToken"} -Uri $apiUrl -Method Post -Body $bodyJSON -ContentType 'application/json'
#remove your admin user from the team
Remove-TeamUser -User $UserName -GroupId $TeamGroupID

You have now successfully posted to a channel directly from PowerShell. Congratulations! Log in to your Team an see the result. I think this is great stuff and will definitely be part of my governance processes moving forward graph1

The best Microsoft Ignite to date

I had a blast at Microsoft Ignite 2018! Here are some reasons why I think it was the best to date:

  • The product groups were accessible and always available for feedback. If you went to the different product group booth you would find prominent members available to chat and discuss their products.
  • Less walking distance, since everything was organized in the same building. This is a great improvement over all other the Microsoft Ignite’s the previous years
  • The focus om community engagement was apparent this year with Community hours and available podcast booths and locations. Even more community members got to share their experience in breakout sessions, meetup sessions, and theater sessions. The community hours had even more people from the product groups join and you got to ask your burning questions and have a great discussion

Ignitecommunity

Microsoft Ignite 2018 group photo with the Microsoft Teams Product Group and MVP’s

This is at least my experience and I may be biased as I got to have a great time delivering three theater sessions, a meetup, guest two podcasts and spend time at the Microsoft Teams booth. But still, compared to the previous years, the vibe during this year Microsoft Ignite was great. If you are thinking of attending next year, make sure you register as soon as possible, for it is going to be awesome. You can pre-register for November 4-8, 2019, in my favorite vacation location, Orlando

Links to my session recordings and slide decks

THR2137 – OneNote Life Hacks

IgniteOLF.png

THR2138 – Stream meetings with Microsoft Teams Live Events

Igniteliveevents

THR2241 – Meetings best practices in Microsoft Teams

Ignitemeetings

Podcast: Skype for Business & Microsoft Teams MVP Roundtable

pod1.png

Podcast: Microsoft Teams news – Live Podcast Discussion

pod2

I also had the pleasure of bringing all of CloudWay AS  to Orlando this year and had great fun together with Jan Ketil Skanke and Alexander Holmeset. I think networking is a big part of conferences such as Microsoft Ignite, that is why we co-hosted Norwegian networking event at Bahama Breeze together with KPMG, Pexip and Microsoft Norway. Read about our activities here

CW1Ignite18V1

Speaking at Microsoft Ignite 2018

I am so proud to return as a speaker for the fourth time at Microsoft Ignite 2018, at my favorite vacation spot, Orlando, FL.

29542728_10155933429450622_4000566362420889272_n

I will share my experience with Microsoft Teams meeting best practices in two expo theater sessions. I will again share my passion for personal productivity using OneNote in a third expo theater session. I will team up with featured speaker, Brian Ricks, and other Teams/Skype MVP’s for ask us anything on troubleshooting Teams and Skype in my first ever meetup.

THR2138V5

Check out my Teams Live Events session

I am scheduled to be at the Microsoft Teams booth during happy hour on Monday so if you have any burning questions or want to hang out and chat, look me up. I would love to whiteboard some migration scenarios or Teams lifecycle scenarios :)

Microsoft Ignite is a huge event for networking with your peers, that is why I am happy that my company is encouraging that by being a co-host for Norsk Aften on Tuesday.

This is going to be fun! See you there :)

Microsoft Teams Direct Routing GA

Today Microsoft Teams Direct Routing was announced as General Available. This is the means for you to bring your own SIP trunk to Microsoft Teams using only a standard SBC. Today AudioCodes and Ribbon are certified SBC’s for Direct Routing and more are in the works. There are three flavors to Direct Routing

Hosted in Azure!

Yes you read correct. AudioCodes has a certified SBC that now is supported in Azure, which means you can run your Direct Routing SBC in Azure as an appliance.

DRGA6.PNG

Installed in your datacenter connected to your PBX or SIP trunk

With Direct Routing you do not need any Skype for Business or Teams components installed in your datacenter to provide voice for your Teams users. All you need is a certified SBC, a public IP address and a public certificate to connect. Read my blogpost on infrastructure requirements for setting up Direct Routing in your datacenter

DRGA2.png

Hosted by a partner

One SBC can connect to multiple Office 365 tenants making this scenario scalable. This means you can consume native Microsoft Teams services from your own tenant and have a service provider host your voice connectivity.

DRGA3

Thoughts

I think Direct Routing will make Cloud Voice mainstream and it can be combined with Calling Plans where available, which means that you can freely choose how to consume voice. Being able to install the SBC in Azure means that anyone can now host and conenct their own sip trunk to Office 365. With the ability to either get this hosted or set up with next to no on-premises infrastructure you have a solution that can be consumed by most customer types from SMB to Enterprise.

References

Microsoft Teams Direct Routing explained

Microsoft Teams Direct Routing is General Available as of June 28, 2018. This is the means for you to bring your own SIP trunk to Microsoft Teams. To be clear, this will only give your Teams users PSTN connectivity, your Skype for Business Online users still needs to use CCE or Skype for Business Server hybrid to get PSTN connectivity.

The goal of this article is to explain the basic around Direct Routing from an infrastructure point of view.

Licenses

  • You need a Phone System License  per user, which is part of Office 365/Microsoft 365 E5 or add-on for Office 365/Microsoft 365 E3
    • Phone System is not available as add-on for Office 365 Business Premium or Microsoft 365 Business
  • To get a phone number in Teams meetings, you need the Audioconferencing license per user, which is part of E5 and can added as add-on for E3 and Business SKU’s

Firewall ports and protocols

  • To connect a sip trunk to Microsoft Teams, a SIP proxy is used.
    • From your SBC to the SIP proxy you need always to use port 5061
      • From SIP proxy to your SBC you can choose any port between 1024 – 65 6536
      • I prefer to use 5061 since it is the same port as SIP proxy and it may be simpler in the long run
      • Traffic needs to be open both ways
    • You can limit the connectivity to the pstnhub.microsoft.com addresses specified below and the IP addresses they resolve to
      • you should always use sip.pstnhub.microsoft.com as primary as it is a Global FQDN
      • sip-all.pstnhub.microsoft.com is mentioned in the documentation and can be a possible source DNS name
  • Media range is UDP between the ports 49 152 – 53 247
DirectRouting4

SBC requirements

TeamsDirectRoutingV3
Make sure you download and import the Microsoft public certificate root found here https://docs.shanehoey.com/directrouting/planning/certificate

Media Bypass internally

  • The advantage of media bypass in a Direct Routing scenario where server is in the cloud is that media stays local and the media path is more optimal
  • Media bypass is supported by AudioCodes and Ribbon
    • needs to be configured specifically on SBC and enabled in Office 365
    • both vendors support ICE light which is used for connectivity checks when finding optimal media path
  • The clients need to be able to resolve and connect the public IP of the SBC
    • traffic needs to be open both ways, same media ports are used
    • requires hair pinning on NAT device
DirectRoutingMB1.PNG

Media Bypass externally

  • Media bypass is possible from clients logged on outside the corporate network
  • The client needs to resolve the SBC FQDN and connect to the IP
    • This results in allowing any IP as source ip on the media port range on the SBC
    • Since only TLS connections are allowed, I think this is something that can be considered
  • If the client cannot connect to the IP it will relay media via the SIP Proxy
DirectRoutingMBext1

Migrating to Direct Routing

Since CCE or Skype for Business Server cannot provide voice for Microsoft Teams, the only viable migration path is to introduce a SBC or configure the current SBC to connect to Microsoft Teams. From there you can start moving users by routing specific numbers and number series over to the new SIP trunk.

If you use direct SIP trunk with your Skype for Business Server today, then you can test Direct Routing by implementing a SBC and connect it to Microsoft Teams. Then provide a SIP trunk from Skype for Business using the inter trunk routing feature in Skype for Business Server, which allows you to move some test numbers to the SBC and Microsoft Teams. When you are ready to move to Microsoft Teams, you can switch the PSTN SIP trunk to go directly to the SBC.

pathtothecloud

Summary

When you have the correct approach from an infrastructure point of view, then you are ready to create PSTN usages and voice policies in Office 365. After that, users need to be enabled for enterprise voice and get assigned a number. Then you are ready to succeed with Microsoft Teams Direct Routing

References