Microsoft Graph Getting preferred language

Pako Porras 81 Reputation points
2020-08-07T10:34:16.203+00:00

Hi:

I'm trying to retrieve my Azure AD user info making a call to https://graph.microsoft.com/v1.0/me and I can get properties like GivenName, Mail... but also I need the preferredLanguage property and it returns null for that property. I tried with other users from my Azure AD and i's allways null.

How is mapped the property preferredLanguage? Where can I set the language of my user and get it calling the microsof graph?

Thank you

Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

Accepted answer
  1. soumi-MSFT 11,831 Reputation points Microsoft Employee Moderator
    2020-08-07T14:09:14.057+00:00

    @Pako Porras , Thank you for reaching out. If the user(s) are all managed users (in cloud users), you can use PowerShell to set the preferred language for them.

    Connect-AzureAD  
    #To set the preferred language  
    Set-AzureADUser -ObjectId {Object-Id of the user} -PreferredLanguage {language-code, for eg: **en** for **English**}  
      
    #To check the preferred language  
    Get-AzureADUser -SearchString {userPrincipalName} | select DisplayName, Preferredlanguage  
    

    Once you have got this set you can also use the Microsoft Graph API also to fetch this same information:

    16446-userinfo.png

    Note: You can get the list of supported language here: https://learn.microsoft.com/en-us/azure/active-directory/external-identities/user-flow-customize-language#supported-languages

    In case the user is an On-Prem user, then you would have to first get the preferred language set in the on-prem domain and then get that synced. You can find mode details around this here: https://learn.microsoft.com/en-us/office365/troubleshoot/access-management/set-language-and-region

    Hope this helps.

    Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as Answer; if the above response helped in answering your query.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.