Skip to content

Enrich Microsoft 365 profile card with extensions and custom attributes

Microsoft 365 is equipped with a very nice, but underestimated feature: Profile cards. I’m sure you know Microsoft Delve, and how it can enrich your Office 365 profile with relevant information such as hobbies, working hours, skills, and your birthday. Next to that, you can find information about recent projects, and the people that you worked with.

All this information and insights are getting more and more integrated with the profile card feature. You can find the profile card in almost any web version of Office 365.

Make additional attributes visible

Next to custom attributes, there are a few additional attributes that you can enable on the profile card, such as:

  • UserPrincipalName
  • Fax
  • StreetAddress
  • PostalCode
  • StateOrProvince
  • Alias

When enabled, these attributes are showing up in the profile card. You don’t need any translation, because localization is built in. I will show you how to enable these later in the post. In this example, the card is expanded with the Alias and UserPrincipalName:

Custom attributes

You can also enrich your profile cards with additional attributes that are normally not visible to your users. You can pick any of the 15 ExtensionAttributes or onPremisesExtensionAttributes (in case of hybrid), and add them to your profile card. These extension attributes are also known as Exchange custom attributes 1-15.

In this example I added 4 extra attributes to the card:

  • Cost Center
  • Employment
  • Employee number
  • Date of entry

There are a couple of ways to see these attributes, for example by using the Graph Explorer.

GET https://graph.microsoft.com/beta/users/{UserPrincipalName}

They are also visible in the the Exchange Admin Center.

How it’s done

So, how do we add these attributes? In this example, I use Graph Explorer to extend the profile card. It is an easy process. But first things first:

  • in order to do this, you need to be a Global Administrator
  • you can add only one profileCardProperty resource at a time
  • it can take up to 24 hours before the additional fields show up on the card (mine took about 8 hours at least)

How to add additional attributes

Go to Graph Explorer and sign-in with your Global Administrator account. Use the following API request to add the UserPrincipalName to the profile card. Make sure you replace the tenantID value. How to find your tenantID.

POST https://graph.microsoft.com/beta/organization/{tenantid}/settings/profileCardProperties
{
  "directoryPropertyName": "UserPrincipalName"
}

You can use UserPrincipalName, Fax, StreetAddress, PostalCode, StateOrProvince, and Alias.

Note: The additional properties field label will automatically be shown in the language settings that the user has specified for Microsoft 365.

How to add extension attributes

Adding extension attributes are a bit more work because you also have to take care of the translation. Each attribute label can have localized values, however, this is not mandatory.

POST https://graph.microsoft.com/beta/organization/{tenantid}/settings/profileCardProperties

In this example, I also added the Dutch translation for Cost center, which is “Kostenplaats”. The language tag is “nl”. I found this post where you can find your language tag.

{
    "directoryPropertyName": "customAttribute1",
    "annotations": [
        {
            "displayName": "Cost center",
            "localizations": [
                {
                    "languageTag": "nl",
                    "displayName": "Kostenplaats"
                }
            ]
        }
    ]
}

In case you don’t want to add localization, the body will look like this:

{
    "directoryPropertyName": "customAttribute1",
    "annotations": [
        {
            "displayName": "Cost center",
            "localizations": []
        }
    ]
}

The attributes can be replaced with the following values:

extensionAttribute1 = customAttribute1
extensionAttribute2 = customAttribute2
……
……
……
extensionAttribute15 = customAttribute15

Source: Customize the profile card using the profile API in Microsoft Graph (preview) – Microsoft Graph | Microsoft Docs

To see the current configuration of your profile card, simply run:

GET https://graph.microsoft.com/beta/organization/{tenantid}/settings/profileCardProperties

My card looks like this:

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#organization('39a5568b-aaxd-xxa-a6a5-xxxxxxxxx')/settings/profileCardProperties",
    "value": [
        {
            "directoryPropertyName": "customAttribute1",
            "annotations": [
                {
                    "displayName": "Cost center",
                    "localizations": [
                        {
                            "languageTag": "nl",
                            "displayName": "Kostenplaats"
                        }
                    ]
                }
            ]
        },
        {
            "directoryPropertyName": "UserPrincipalName",
            "annotations": []
        },
        {
            "directoryPropertyName": "Alias",
            "annotations": []
        },
        {
            "directoryPropertyName": "customAttribute2",
            "annotations": [
                {
                    "displayName": "Employment",
                    "localizations": [
                        {
                            "languageTag": "nl",
                            "displayName": "Dienstverband"
                        }
                    ]
                }
            ]
        },
        {
            "directoryPropertyName": "customAttribute3",
            "annotations": [
                {
                    "displayName": "Staff number",
                    "localizations": [
                        {
                            "languageTag": "nl",
                            "displayName": "Personeelsnummer"
                        }
                    ]
                }
            ]
        },
        {
            "directoryPropertyName": "customAttribute4",
            "annotations": [
                {
                    "displayName": "Date of entry",
                    "localizations": [
                        {
                            "languageTag": "nl",
                            "displayName": "Datum in dienst"
                        }
                    ]
                }
            ]
        }
    ]
}

After a long 24 hours of waiting, this is what the card looks like:

After changing my Office 365 language to Dutch, the fields are translated. When the users’ language is not available, the default language (en-us) is shown.

Good to know

As stated before, you can only add one attribute at a time. Updating or deleting single attributes is not possible at the moment. When you run either PATCH or DELETE, the whole card is replaced or deleted. So make sure you got a backup of your profile card, and if you need to update or delete, add the “new” items one by one.

Wrap things up

As you can see, this can add a lot of value to your organization. You might already use these attributes, so it’s good to know that you can show them here as well. Not all attributes are meant for that purpose, so it’s best not to expose the ‘salary extension attribute’. Kidding of course! Just want to check if you read this article to the very end. If you made it until here, I’m sure you liked it 😉 I hope this will give you some ideas, and help you further in your cloud journey.

More information can be found here:

Customize the profile card using the profile API in Microsoft Graph (preview) – Microsoft Graph | Microsoft Docs
Customize the profile card in Win32 apps using registry keys – Office Support (microsoft.com)

Stay safe!

25 thoughts on “Enrich Microsoft 365 profile card with extensions and custom attributes”

  1. Pingback: Enrich Microsoft 365 profile card with extensions and custom attributes – 365 admin service

      1. Hi Jan, thanks for writing this up! I had the same question as Ben Stegnink regarding rendering custom attributes as hyperlinks. We have a use case to send users to an Office mapping and wayfinding solution to see where someone sits. The system can pull up users just by a unique id in the URL which I could sync the whole URL to a custom attribute into Azure AD if needed. I’m just not sure if it will be click-able.

  2. Great article!
    Do you see your modifications in the Teams client?
    I have tested modifications and they can only be seen in Outlook not in Teams

  3. this solution is not working. I am receiving an error ”
    Forbidden – 403 – 281ms. You need to consent to the permissions on the Modify permissions (Preview) tab”
    any idea?

    1. That should be a tab two over from the “Request” tab that holds the request body (under the URL). Fwiw when I clicked it I got the below message and sorted myself out in the permissions pane.

      Permissions for the query are missing on this tab. Open the permissions panel to see the full list of Microsoft Graph permissions and select the permission(s) you want and consent to them from there.

  4. Hi Jan,
    Great article and I was able to implement it successfully.
    However I get strange behaviour in the profile card because I see the addition attributes in Outlook Web but I don’t see the attributes in local Outlook.
    Are there any additional features which I need to enable or is this by design?

  5. Pingback: Customize People Card Microsoft 365 | KTNN SharePoint

  6. Hi – Great article, but how is this regarding using Microsoft Search. I have tried to do a search for values in the custom attributes I’ve added to the profile card. Search do not return any results. Is it possible to config search so that I got search results when searching for values in the custom attributes?

  7. Hi Jan,
    Great post, thanks for writing up. I tried the same and I was able to see the properties in the Outlook profile card but not in MS teams. Will it support MS Teams Profile Card as well?

  8. Hi,
    Is it possible to display SharePoint User profile property on the Contact tab instead of the Additional Information tab ?

    I do see my custom attribute appearing in Additional Information tab, however, I want it to be displayed in Contact tab. Any suggestions or ideas for this one please ?

  9. I am eagerly waiting the ability, one day, please!, to have the renamed values appear in the Admin Center as well so you can actually see what each one means when you’re trying not to accidentally put a Cost Center in the Work Hours field on a new hire, without having to have a list written somewhere that keeps them all straight…

  10. I understand how to add values to the ProfileCard, but this is a moment-in-time addition. I’m trying to warp my mind around customattributes that get updated by HR. I feel like I’d need some sort of daily scheduled task to run a script to update the ProfileCard, but I’m at a loss of how to accomplish this. Any ideas?

Leave a Reply

Your email address will not be published. Required fields are marked *