I am trying to run a script in PowerShell to calculate the users usage in several workspaces in PowerBI. Since I am relatively new to all of this, I have been following the steps stated in the following article:
https://www.proserveit.com/blog/power-bi-usage-metrics-across-all-workspaces
Once I get to the step of actually running the script with PowerShell and starting the subscription I get the following error:
Invoke-RestMethod : {"error":{"code":"AF10001","message":"The permission set () sent in the request does not include the expected permission."}}
At C:\Users\MyName\OneDrive\Documents\PowerBI\Blog-master\PowerBIUsage\Scripts\Get-PowerBIUsage.ps1:27 char:17
+ ... $response = Invoke-RestMethod -Uri $uri -ContentType "application/x-w ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
I have tried updating to TLS 1.2 and it still doesn't work. I am probably missing something very obvious but I still cannot work out how to fix this. Thank you.