Customizing the Microsoft 365 Profile Card with the Graph Explorer

Making the Microsoft 365 Profile Card Your Own

Updated 12 November 2023

In Office 365 notification MC217813 (published 1 July and updated on 15 July), Microsoft announced that: “You will be able to customize profile cards according to your organization business needs. The profile card is sometimes referred to as a contact card or people card.” (Microsoft 365 roadmap item 61502).

The new functionality sounds promising. The profile or people card displays information about someone in different places in Microsoft 365 applications. For instance, you can select an email sender or recipient in Outlook or Outlook mobile to view the details of that person. If they’re someone in your organization, the profile card shows you information from their Azure Active Directory account. The information is more limited for external people.

Customizing the Profile Card

The announcement points to documentation about how to customize the profile card. Essentially, you update the ProfileCardProperty Graph resource to add new information to the Microsoft 365 profile card. Six standard Azure Active Directory properties can be added along with the fifteen custom attributes available for organizations to use as they wish (like CustomAttribute11, which Microsoft recently considered using to identify the room mailboxes needed for its Workspaces feature). Custom attributes are used for many purposes, including to hold organizational information (like cost centers and division names), mark mailboxes for special processing, and so on.

Nice as it is to be able to customize the profile card, the immediate barrier facing many tenant administrators is not knowing how to interact with the Graph to update the ProfileCardProperty resource. Not everyone has mastered Graph programming, and administrators who know PowerShell might not yet have ventured into interacting with the Graph (some examples of using PowerShell with the Graph are listed below).

Graph Explorer Delivers an Answer

As it turns out, the Graph Explorer makes it easy to apply the necessary changes. This is a browser interface to allow people to interact with the Graph and get to know how Graph transactions work against different endpoints, such as Groups, Outlook, Planner, and SharePoint. You can run commands against test data or, after signing into a tenant account, against live data. Programmers can grab code snippets generated for transactions by the Explorer in C#, Java, JavaScript, and Objective-C and include the code in their programs. All in all, the Graph Explorer is a very useful tool.

Using Graph Explorer to Update the Profile Card

The key points about using the Graph Explorer to update the ProfileCardProperty resource are:

  • Sign in with an administrative account for the tenant.
  • Use a POST command to update the https://graph.microsoft.com/v1.0/admin/people/profileCardProperties endpoint.
  • Put the update you want to execute in the request body. For example, to add the PostalCode property to the profile card, I put {“directoryPropertyName”:”Postalcode”} in the request body.
  • Click Run query when you’re ready. If everything’s been done right, you should see a 200 response. This means that the Graph has accepted the update.

Figure 1 shows the Graph Explorer after running a successful update. You can see the 200 response.

Using the Graph Explorer to update the ProfileCardProperty resource with a POST command

Microsoft 365 profile card
Figure 1: Using the Graph Explorer to update the ProfileCardProperty resource with a POST command

You can make multiple updates to add more properties or add all the properties at one time by including them in the request body. For example, this request body specifies three properties to add to the profile card:

{
  "directoryPropertyName": "StreetAddress",
  "directoryPropertyName": "PostalCode",
  "directoryPropertyName": "userPrincipalName"
}

Microsoft warns that it takes up to 24 hours for the changes to show on user profile cards. It also seems that you need to add updates one by one and wait until an update is active before applying another. To check the current state of the ProfileCardProperty resource, you can run a GET command to see what’s returned by https://graph.microsoft.com/v1.0/admin/people/profileCardProperties.

Figure 2 shows that I have added two of the standard properties (UserPrincipalName and StreetAddress) and CustomAttribute12. Note that the custom attribute is assigned a display name of “Cost Center” to make its use more obvious to end users.

Checking updates applied to the ProfileCardProperty resource with a GET command

Microsoft 365 profile card
Figure 2: Checking updates applied to the ProfileCardProperty resource with a GET command

The Microsoft Graph PowerShell SDK can retrieve details of custom properties. For example, this output shows that the tenant customized the profile to include three standard attributes for Azure AD accounts (userPrincipalName, StreetAddress, and PostalCode) and added two custom attributes to display the user’s cost center and preferred drink, which are stored in CustomAttribute12 and CustomAttribute9 respectively:

Connect-MgGraph -NoWelcome -Scopes "PeopleSettings.ReadWrite.All","PeopleSettings.Read.All"

Get-MgAdminPeopleProfileCardProperty | Format-List

Annotations           : {}
DirectoryPropertyName : userPrincipalName
Id                    :
AdditionalProperties  : {}

Annotations           : {Cost center}
DirectoryPropertyName : customAttribute12
Id                    :
AdditionalProperties  : {}

Annotations           : {}
DirectoryPropertyName : StreetAddress
Id                    :
AdditionalProperties  : {}

Annotations           : {}
DirectoryPropertyName : Postalcode
Id                    :
AdditionalProperties  : {}

Annotations           : {Drink}
DirectoryPropertyName : CustomAttribute9
Id                    :
AdditionalProperties  : {}

Viewing Custom Profile Cards in Applications

After the Graph processes everything and applications refresh their cache, you’ll see the customizations show up in the profile cards displayed by applications. Figure 3 shows how OWA displays customized contact information in the Microsoft 365 profile card while Figure 4 shows how the card appears in Outlook Mobile.

OWA displays a customized Microsoft 365 profile card
Figure 3: OWA displays a customized Microsoft 365 profile card
Outlook Mobile displays a customized Office 365 profile card
Figure 4: Outlook Mobile displays a customized Office 365 profile card

The customized attributes don’t appear for guest accounts.

If you make a mistake and add the wrong attribute or want to start over, you can remove an attribute from the organization settings by running a DELETE request. For example, to remove CustomAttribute15 from the set shown on the user profile card, run a DELETE request against https://graph.microsoft.com/v1.0/admin/people/profileCardProperties/customAttribute15

Gets Real Work Done

The notion of having to write code to interact with the Graph might well have turned people away from even considering customizing the profile card. The Graph Explorer allows you to do the job without writing a single line of code. It’s a great example of using an available tool to achieve a goal in a way that the authors of the feature probably never considered.

Some PowerShell with Graph Articles

How to report SharePoint Online site usage.

Fetching Azure AD Account Sign-in Information.

Fetching Planner Data for a Single User.

Generating a User Activity Report.

Handling pagination when fetching Graph data.

40 Replies to “Customizing the Microsoft 365 Profile Card with the Graph Explorer”

    1. I didn’t investigate this because Graph Explorer grabs the necessary permissions once you sign in with an administrative account.

  1. When I try to change the display name, I get a 409 Conflict error. Any idea what’s causing that?

    {
    “directoryPropertyName”: “CustomAttribute1”,
    “annotations”: [
    {
    “displayName”: “Comms”
    }
    ]
    }

    1. Maybe try a different word than Comms? That might be a reserved word. I don’t know, so this is a guess…

  2. Is it possible to stop the profile card from appearing – ie if we created a competition tenant but didnt want participants to see personal details about other users in the tenant when they hover over them in Teams.

    1. Teams doesn’t use the People card. It has its own version which limits the amount of information shown to guests.

  3. Hello, I have a question on this. I did a Azure sync to make sure the new custom attributes are showing using the AD Connect application. The attributes came over but the Tennant Schema appended the following “extension_APIID#_customAttribute” to the front of the “directorypropertyname” an when I try to add the attributes to the contact cards and waiting the 24hours nothing shows up. What am I missing?

    {
    “directoryPropertyName”: “extension_d21d1be3dd6c42ebb26126a6392c4126_customAttribute1”,
    “annotations”: [
    {
    “displayName”: “Dial Code”
    }
    ]
    }

    When I post the code in Graph Explorer i get a success message back but nothing is posted to the contact cards.

      1. This is our 0365admin account that i’m using to sign in to graph explorer to get the attributes to show up on everyone’s contact cards. I was following your steps using just customAttribute1 etc… and that didn’t work.

  4. I think the real issue is I didn’t know the tenant schema api was adding the prefix to those. We are hybrid right now until we get every mailbox migrated over to O365.

  5. I’m trying to map extensionattribute8 to customattribute8 and display on the outlook client profile area. It displays in OWA but not outlook client, any ideas as to why? It has been longer than 24 hours and I have forced a download of the address book.

  6. If the customattribute8 field is displayed in OWA but not outlook client, what could be a possible cause? Its been longer than 24 hours and address book has been forced to download on the client side. Thank you

  7. It is very annoying when you‘re trying to make this work in a hybrid constellation.. i need the costum attributes visible in the native outlook app, in MS Teams and in OWA. This once again shows me, that Microsoft is lacking behind with things like that.

    I think, nobody has a working way to add costumer attributes to the profile card on all mentioned systems..

    Very very annoying!

  8. Hello, thanks for this post, but is there a way to customise the “Overview” tab, rather than the “Contact” tab?

  9. Is there some hard limit how long custom contact value can be e.g. how many characters?

    1. There’s definitely a limit but I can’t say what it is. I think the practical limit is how much of a custom value can appear on a profile card. You could test to establish the practical limit, which I suspect is much smaller than the theoritical.

  10. I understand how to add values to the ProfileCard, but this is a moment-in-time addition that doesn’t dynamically update. I’m trying to wrap my mind around customattributes that get updated for a user sporadically 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?

    1. Personally, anytime I need to have a job run on a regular basis, I create a runbook and execute it using an Azure Automation schedule.

  11. Is there any way to add a line break to the Street Address? In the photo above, it shows just the first line of the Street Address in the card, but the mobile view shows all.

    If someone is in several divisions or departments (say a rep or manager), all their assignments may not fit in one line of an attribute.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.