Teams Call quality SignIn issue

2023-03-10T16:20:11.7333333+00:00

Hi ,

I am trying to get the Teams data using PowerShell as below without asking for the signIn popup dialog box.

$tenantId = "xxxxxxxxxxxx"
$appId = "xxxxxxxxxxx"
$appSecret = "xxxxxxxxxxxx"
$scope = "https://cqd.teams.microsoft.com/.default"
$authority = "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token"
$body = @{
    client_id     = $appId
    client_secret = $appSecret
    scope         = $scope
    grant_type    = 'client_credentials'
}
$accessTokenResponse = Invoke-RestMethod -Uri $authority -Method Post -Body $body
$accessToken = $accessTokenResponse.access_token

$startDate = Get-Date -Date "2023-03-08"
$endDate = Get-Date -Date "2023-03-09"
$data = Get-CQDData -BearerToken $accessToken -ReportId "calls" -StartDate $startDate -EndDate $endDate

If i use only Get-CQDData without parameters, it is working. But it will ask for sign in popup.

getting the error as:

Get-CQDData : A parameter cannot be found that matches parameter name 'BearerToken'.

If any idea Please suggest on SignIn issue.

Thanks

Satya

Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. James Parkes (MSFT) 0 Reputation points Microsoft Employee
    2023-03-13T16:03:31.86+00:00

    The CQDPowerShell module requires the user to log in manually and does not support programmatic access. This is to prevent export-type queries from running repeatedly against the CQD back-end and overloading the service.

    I would recommend exploring CallRecords in Graph API to see if that fits your requirements.


  2. James Parkes (MSFT) 0 Reputation points Microsoft Employee
    2023-03-13T16:03:04.9833333+00:00

    The CQDPowerShell module requires the user to log in manually and does not support programmatic access. This is to prevent export-type queries from running repeatedly against the CQD back-end and overloading the service.

    I would recommend exploring CallRecords in Graph API to see if that fits your requirements.

    0 comments No comments

  3. Vasil Michev 124.7K Reputation points MVP Volunteer Moderator
    2023-03-10T17:53:56.39+00:00

    There's no such parameter in the cmdlet definition, and afaik the underlying endpoints do not support the client credentials flow.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.