Microsoft recently released the ability to programmatically retrieve Microsoft Teams PSTN usage records using the Graph API. This data is currently available in the Teams admin center under Analytics & Reports > Usage Reports > PSTN & SMS Usage.
Inspired by Lee Ford’s Get-TeamsPSTNCallRecords script, Jeff Brown wrote a new version of the module to work with the Graph API to retrieve these records. Jeff approached the solution in a different way:
Check out the module code and some instructions for setting up the Azure application registration, importing the module, and some sample commands in JeffBrown’s GitHub repository:
GitHub: JeffBrownTech / TeamsCloudCommunicationApi
You can download the module directly from the PowerShell Gallery with the following command:
Installmodule -name TeamsCloudCommunicationApi
PS: This Graph API is currently in beta and is not recommended for production so use at your own risk. You can learn more about the Cloud Communication API through Microsoft Docs here: Working with Communications API in Microsoft Graph