Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
23 | |
3 | |
2 | |
2 | |
2 |