Bringing the Active Directory Drink Attribute to Azure AD

Drink and the Active Directory Schema

Twitter last week was full of news about the drink attribute, which is part of the Active Directory schema and defined in Microsoft documentation as “The drink (Favorite Drink) attribute type specifies the favorite drink of an object (or person).” Quite why drink was ever added to Active Directory is a mystery, but it’s there for all versions of the Windows Server operating system from Windows Server 2003 and available for people to use as they wish. However, it’s not part of Azure Active Directory, and again no one can explain why. But it’s not and, according to Microsoft, will not be.

Use Custom Attributes Instead for the Microsoft 365 Profile Card

The lack of drink in Azure AD poses a quandary to those who need to populate the attribute. You cannot extend the Azure AD schema to add attributes, so the only thing to do is to make the best of what’s available. In a nutshell, you can use one of the fifteen single-value custom predefined in Azure AD for organizations to use as they wish. You can’t rename the attributes, but you can use them to hold data.

A quick check of mailboxes revealed that CustomAttribute9 wasn’t in use. It’s important to check to make sure that the chosen attribute isn’t used to store information used for another purpose. With the decision made. To update CustomAttribute9 with a user’s drink preference, you can set the value for their mailbox with PowerShell using the Set-Mailbox cmdlet as follows:

Set-Mailbox -Identity James.Joyce -CustomAttribute9 "Beer"

Updating a custom attribute for an Exchange Online mailbox leads to synchronization of the information to the mailbox owner’s account in Azure AD. I spent some time looking at how to update the custom attribute using the Azure AD PowerShell module and could find no method to do this.

It would be nice to be allowed use one of the five multi-value custom attributes available for mailboxes and also in Azure AD (ExtensionCustomAttribute1 through ExtensionCustomAttribute5) as you could then store the preferred brand name along with the choice of beverage, but these attributes aren’t currently supported for customization of the profile card.

Update Azure AD Schema to Display Drink

Once the chosen attribute is populated, we can use the Graph Explorer to update the Azure AD schema to make information about users’ preferred drinks appear in the Office 365 people card. I used this payload to define that the contents of CustomAttribute9 is displayed as Drink in the profile card.

{
            "directoryPropertyName": "CustomAttribute9",
            "annotations": [
                {
                    "displayName": "Drink",
                    "localizations": [
                        {
                            "languageTag": "de",
                            "displayName": "Getränk"
                        }
                    ]
                }
            ]
        }

The customization to the profile card doesn’t happen quickly and it can take up to 24 hours before you see the effect. Eventually, all the necessary processes click into place and the profile card will display the information (Figure 1).

The user's beverage of choice is displayed in their Microsoft 365 profile card
Figure 1: The user’s beverage of choice is displayed in their Microsoft 365 profile card

It’s unlikely that many organizations will decide that including drink in a customized profile card is an essential contribution to the business. But in the interest of completeness, we felt it important to let people coming from the on-premises world to the cloud that although the drink attribute doesn’t exist in Azure AD, they can still make it show up.


Sometimes we come across strange but interesting technical topics as we research and write the Office 365 for IT Pros eBook. This post falls into that category. On a serious note, it’s yet another example of using the Graph Explorer to do real work. But apart from that… it’s just an excuse to have a drink.

One Reply to “Bringing the Active Directory Drink Attribute to Azure AD”

Leave a Reply

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