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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors