Getting user's country in PowerShell

Christine VACHER 21 Reputation points
2022-10-20T17:49:55.263+00:00

I am able to get someone's country like this

https://graph.microsoft.com/v1.0/users/<userid>?$select=Country  

or this

https://graph.microsoft.com/v1.0/users/<userid>/Country  

I don't get the same information for the same users in Powershell. The Country property does not seem to be set.

PS> $User = Get-MgUser -UserId $SameUserid  
PS> $User.Country  
 *-> nothing returned <-*  
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. John Sutherland 41 Reputation points
    2024-01-02T17:19:01.1333333+00:00
    0 comments No comments

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.