question

PakoPorras-1857 avatar image
0 Votes"
PakoPorras-1857 asked MaliSwagatBT-8270 published

Microsoft Graph Getting preferred language

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

azure-ad-graph
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

soumi-MSFT avatar image
0 Votes"
soumi-MSFT answered MaliSwagatBT-8270 published

@PakoPorras-1857, 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://docs.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://docs.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.





userinfo.png (38.1 KiB)
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@PakoPorras-1857, Just wanted to check if the above response helped in answering your query. Do let me know if there are any more queries around this so that we can help you further.

0 Votes 0 ·

is it possible to do that through Azure portal?

0 Votes 0 ·

@PakoPorras-1857, Yes, you can achieve it through the portal, but you would have to use the O365 portal to make this change and it cannot be done through the Azure AD portal.

Please refer to the following link for more details: https://docs.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 Votes 0 ·
Show more comments

Can we able to update the preferredLanguage using Azure Graph API's?

0 Votes 0 ·