Obtaining phone numbers from teams users in other tenants

Thomas Kim 0 Reputation points
2023-12-13T21:44:39.4833333+00:00

We are wondering if it would be possible for an application to obtain phone numbers for teams users in another tenant. We have an application set up that allows cross tenant teams recording through the use of a bot and complaince policies. However, we also want to be able to obtain the phone numbers of the users that are being recorded.

Ideally, we want to be able to do this with the c# graph SDK. If this isn't possible, is there a way to do this through powershell?

Microsoft Teams | Development
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Prasad-MSFT 9,061 Reputation points Microsoft External Staff Moderator
    2023-12-14T10:57:56.41+00:00

    You can use Microsoft Teams PowerShell module to obtain phone numbers.

    • Install the Microsoft Teams PowerShell module. You can find the module here.
    • Connect to the other tenant using the Connect-MicrosoftTeams cmdlet and authenticate with the necessary permissions.
    • Use the Get-CsPhoneNumberAssignment cmdlet to retrieve the phone numbers. Here's an example command:
    Get-CsPhoneNumberAssignment -UserId "user-id"
    

    Replace "user-id" with the user ID of the Teams user in the other tenant.
    https://learn.microsoft.com/en-us/powershell/module/teams/Get-CsPhoneNumberAssignment?view=teams-ps

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    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.