I'm trying to find out if there's a way to extract "building address" information from a user's contact details within Microsoft Teams. I've done quite a bit of research but haven't found anything that really helps. If anyone knows how to grab this information from Teams, I'd greatly appreciate your input! Here's a link that shows what I'm specifically looking at.
2 Answers
Just a heads up, the building address isn't a direct property of Teams; it's more related to Active Directory (AD) or Azure Active Directory (AAD). Are you needing this info for marketing? I mean, if it's your organization, shouldn't that data already be available to you?
From what I've seen, the Microsoft Graph API is your best bet for accessing information in Microsoft 365, including what you're looking for. You’ll likely need to use the MSGraph PowerShell module for this. Check out their official documentation for details on how to get started: [Microsoft Graph User Contact](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.personalcontacts/get-mgusercontact?view=graph-powershell-1.0).
Here's a handy example to help you out: [Using Get-MgContact in Graph PowerShell](https://m365corner.com/m365-powershell/using-get-mgcontact-in-graph-powershell.html). This should give you a clearer idea of how to implement it.

It's actually for reporting purposes. My organization has strict restrictions in place and since I'm not the Teams administrator, it's a bit tricky. I need the info to help categorize data based on building locations.