Sync Local Outlook Contacts to a Teams Desk Phone

Update 07.05.2022

This blog post is now obsolete. Microsoft has now added Outlook Contacts to Teams Desk Phones.

Outlook Contacts finally do show up on Teams Desk Phones!

Original Story

Since the second generation of Teams certified desk phones have been released, many things have been improved. They’re now much faster and also got a lot of software updates. They still have one major flaw though. They’re only able to show your “native Teams contacts” instead of all contacts which are synchronized from Outlook to Teams.

This article states the following for a previous software update:

Contacts whose numbers are saved in Outlook will be available in the People section of the Teams phones with read-only access. You’ll still need to manually dial the number

No matter what I tried, I was not able to get any contacts which are synchronized by Outlook to Teams to show up on my desk phone.

Let’s take a look at our contacts in the Teams client. Contacts which have been added using the Teams clients can be edited. Contacts which have been synchronized by outlook, can’t. You can see that the three dots are greyed out on the first entry while they’re not on the second entry.

On my desk phone, I can’t see the first contact (synchronized one) anywhere.

I’m still not sure what that quoted sentence above means but I have an idea. Since they specifically say that numbers must be dialed manually, I believe that what they actually mean is that if you have synchronized contacts from outlook, their names (instead of their number) will be displayed if a saved contact calls your desk phone.

A quick test confirmed this hunch. I created a contact with my work and my mobile number. I purposely set my work number as mobile and my mobile number as home phone. When synchronizing contacts from Outlook to Teams, Teams will always use the mobile number for the number shown in its contact list. If you’d like to learn more about this, Mark Vale has a great article covering this over at the Commsverse Blog.

Here you can see the Outlook contact.

The number which is declared as Mobile will be showed in the Teams client.

If we right-click the call icon, the other numbers from the Outlook contact will also show up.

So, when I used my mobile to call my desk phone, the name of the Outlook contact indeed showed up on the desk phone, even though that contact is not visible anywhere on the desk phone. This also means that despite Teams is only showing, or at least preferring the mobile number of an Outlook contact in the contact list, it will still use numbers which are hidden behind a right-click for display name lookups.

That’s why I assume that that’s what Microsoft actually meant by that vague statement.

Synchronize Outlook Contacts to Teams

That’s nice and all but it still doesn’t let us select and call our contacts directly from our Teams desk phones. Depending on the number of contacts we need on our phone, manually adding them is not an option either.

If Alexander Holmeset is able to add contacts to a user’s speed dial list by using PowerShell, why not use his method to read all our local contacts from Outlook and add them as native Teams contacts?

With a little help from this article, I was able to get all the users local Outlook contacts and then add them to Teams programmatically.

Since our contacts might have multiple number types like Business, Mobile, Home etc. stored in one object, but Teams contacts support only one number, the script will create one contact for each number type. The number type will then be added as a suffix enclosed in square brackets.

To reduce dependencies, I’m not using the AAD Internals modules to get the user token which is needed to add the contacts. I slightly modified the example from this post. Instead of requesting the token for the Call Queue Opt In / Opt Out service, we’re just requesting a token for normal access to the Teams Web Client. For this to work, you or another user needs to enter his credentials once the login prompt appears. You also need to specify your Teams region by Read-Host. In my case that’s “emea”.

The Script

The script will only add a contact to Teams, if the phone number or the name is not already saved to another Teams contact. It will only look for contacts stored in a user’s Contacts folder inside the personal mailbox.

The Result

Once the script has done its work. We can see that we now have editable contacts in Teams for all our local Outlook contacts. The downside is that there now are multiple entries because of the different sources.

The upside is that a Teams contact will always take precedent over a synchronized contact for incoming call notifications. This means that you’ll always see the number type a person is calling you from.

And of course, the biggest upside is that you’ll finally have the comfort to use your desk phone to quickly call a contact from the tips of your fingers without manually entering the number first.

I hope that this script helps you improve the experience for your end users of Teams certified desk phones until Microsoft provides a better contact management solution.

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Hosted on GitHub Pages
Built with Hugo
Theme Stack designed by Jimmy