Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I'm using the Invoke-PowerBIRestMethod cmdlet in Powershell to enumurate the reports in a given workspace. First, I'm getting the workspaces using the Get-PowerBIWorkspace cmdlet and storing that in a variable:
# get a list of all the workspaces in the tenant
$workspaces = Get-PowerBIWorkspace -Scope Organization -All -Filter "tolower(type) eq 'group'"
Then I'm looping through each workspace to enumerate the reports.
# get a list of all reports in the tenant
$reports = foreach ($workspace in $workspaces)
{
if($workspace.State = "Active")
{
$URL = "https://api.powerbi.com/v1.0/myorg/groups/" + $workspace.Id + "/reports"
$reports = Invoke-PowerBIRestMethod -Url $URL -Method GET
}
}
The problem I'm running into is that the Get-PowerBIWorkspaces returns all workspaces in the tenant, including all the automatically created Office 365 groups. When I pass the workspace ID for one of the O365 groups to the Power BI API to get the reports, I get an error.
Is there any way to programatically filter the workspaces to return *only* actual Power BI workspaces and exclude the O365 groups?
Thanks!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |