Contact Adder – Part 1 - TEAL
post-template-default,single,single-post,postid-1792,single-format-standard,bridge-core-2.6.1,,qode-title-hidden,qode-child-theme-ver-1.0.0,qode-theme-ver-24.6,qode-theme-bridge,disabled_footer_top,qode_header_in_grid,qode-wpml-enabled,wpb-js-composer js-comp-ver-6.5.0,vc_responsive

Contact Adder – Part 1

This month we would like to provide you with a small tool, which we have developed for internal use.

The problem

We use Office 365 for collaboration. Each of our employees has a mobile phone, either IOS or Android. Unfortunately, even when using the Outlook app on the phone, newly created Office 365 users are not automatically synchronized to the phone book of the phones. Telephone number changes are of course not automatically taken over either.

We wanted to change that.

Our solution

As a workaround for this problem, we wrote a small PowerShell script that synchronizes the Office 365 users with the local contacts of Outlook on the notebook. These contacts in turn are automatically synchronized by the Outlook App on the phone.

Implementation details

  • Only contacts that are not empty and Exchange users and have a mobile phone number are exported.
  • Since we had problems with the comparison of the email address field (partly the x500 address is listed there) we write the email address additionally into the field “User Field 1” and compare this.
  • The script does not delete contacts. When someone leaves the company, the remaining employees can decide whether to delete the contact or update it with new and, if necessary, private contact information.


The script

You can find the script in our repository It is licensed under the MIT license.

What‘s up next?

In the next step we will write a small setup, which creates a scheduled task for the script and we improve the logging a bit.

We would like to take this opportunity to thank some of the authors whose work and information we used during the development: [not available anymore at the time of the writing]


Contact Adder – Part 2