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

Join 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.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.