Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Powershell + Get-PowerBIDataset + Operation returned an invalid status code 'TooManyRequests'

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
        }
    }

 

1 REPLY 1
Anonymous
Not applicable

I have noticed that I can call it 200 times until the error shows up.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors