Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have 1500+ Workspaces in my Power BI Tenant. When I loop through the Workspaces and try to Get Reports using the following code snippet, it is working for few workspaces. Around (30 Workspace).
$report = Get-PowerBIReport -Scope Organization -WorkspaceId $WS.Id
After that it started propmpting the following error!
+ CategoryInfo : WriteError: (Microsoft.Power...etPowerBIReport:GetPowerBIRep
ort) [Get-PowerBIReport], TaskCanceledException
+ FullyQualifiedErrorId : A task was canceled.,Microsoft.PowerBI.Commands.Reports.GetP
owerBIReport
Then, any script execution is failing. Is there any Limit to call PowerShell command ? Is there any Timeout Problem with Power BI PowerShell? Any solution for this problem?
Add-PowerBIWorkspaceUser
$apiTraceback = Resolve-PowerBIError -Last
$text = $apiTraceback.Response
[regex]$usernameReg = "(\d\d\d\d)"
$timesleep= $usernameReg.Match($text).Value
Start-Sleep -s $timesleep
Use Invoke-RestMethod with this API call
Admin - Groups GetGroupsAsAdmin - REST API (Power BI Power BI REST APIs) | Microsoft Docs
It supports filtering and pagination, and generally has better performance.
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 |
User | Count |
---|---|
9 | |
7 | |
4 | |
4 | |
4 |