Microsoft 365 Add Shared Contact to user personal mailbox for phone caller identification and more.

less than 1 minute read

Key features

  • Shared conntacts will be added to user personal mailbox.
  • Multiple contacts can be added / updated.
  • Caller ID will be displayed on user Phone.
  • Contact will be displayed in user contact section on mailbox.
  • Contact will be synchonized to user phone contact.

Prerequisites

  • Azure Automation Account
  • Service Principal for credentials

Configuration

Here you can find how to configure your environment step by step. Script is running in version 7 as for big organization reqaired paraller objecte in the same time.

Configure Service Principal

  1. Logon to https://entra.microsoft.com/
  2. Create app registration

  3. Permission granted for application

Configure Azure Automation Account

Import Microsoft.Graph modules


Import-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Beta.Users
Import-Module Microsoft.Graph.Users
Import-Module Microsoft.Graph.PersonalContacts
Import-Module Microsoft.Graph.Beta.PersonalContacts

  1. Logon to https://portal.azure.com
  2. Navigate to automation account
  3. On Menu select Modules -> Add module

  4. Create credentials for Runbook used in script.

User Name: Application ID
Password: Application secret

  1. Create Runbook with PowerShell version 7.X

PowerShell script on GitHub run by Automation Account

GitHub Link

Link to script on GitHub M365-MgGraph-Add-Multiple-contact-Personal-Mailbox.ps1 can also be shown.

Example of contact created in user personal mailbox

Example of output in Outlook

Leave a comment