Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi guys!
I am exporting datasets via Powershell and looping over almost all of our workspaces.
And I am getting "Operation returned an invalid status code 'TooManyRequests'"
How can I solve this in my script so I do not get this error?
What is the limit of requests?
Here is some code from my script where I start looping datasets per workspace.
$result_DataSets =
ForEach ($rec_ws in $result_Workspaces| ? { $_.IsOnDedicatedCapacity -eq 1 -and $_.State -eq "Active" -and $_.Name -Like "N-SWE-*"})
{
$i_ws++
Write-Host "$i_ws - WS: $($rec_ws.name) - (Id:$($rec_ws.id))"
ForEach ($rec_dataset in (Get-PowerBIDataset -scope $filter_scope -WorkspaceId $rec_ws.id | where-object {$_.name -notin "Usage Metrics Report","Report Usage Metrics Model"}))
{
[pscustomobject]@{
WorkspaceName = $rec_ws.Name
WorkspaceID = $rec_dataset.Id
DatasetID = $rec_dataset.Id
DatasetName = $rec_dataset.Name
ConfiguredBy = $rec_dataset.ConfiguredBy
IsRefreshable = $rec_dataset.IsRefreshable
IsEffectiveIdentityRequired = $rec_dataset.IsEffectiveIdentityRequired
IsEffectiveIdentityRolesRequired = $rec_dataset.IsEffectiveIdentityRolesRequired
IsOnPremGatewayRequired = $rec_dataset.IsOnPremGatewayRequired
TargetStorageMode = $rec_dataset.TargetStorageMode
#ActualStorage = $rec_dataset.ActualStorage
CreatedDate = $rec_dataset.CreatedDate
#ContentProviderType = $dataset.ContentProviderType
"Date Retrieved" = $RetrieveDate
}
}
I have noticed that I can call it 200 times until the error shows up.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |