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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How to get workspace,dataset,data source type, report names across organization

Hi,

I am trying to get  workspace , dataset,datasource type, connection string, report names for entire organization tenant. I am trying using below powershell script but i only get about 150+ rows... Can anyone help with this. How to get all these info for entire tenant. I am using admin account.

 

$allworkspace = Get-PowerBIWorkspace -All -Scope Organization
$allworkspace | Where-Object { ($_.Type -ne 'Personal') -or ( $_.Type -ne 'PersonalGroup') }| %{
$workspaceID = $_.Id
$workSpaceName = $_.Name
Write-Host "Checking Workspace :"$_.Name $_.Id -ForegroundColor Cyan

 

$reports = (Invoke-PowerBIRestMethod -Method GET -Url "groups/$($workspaceID)/reports/" | ConvertFrom-Json).value | Select-Object Name,ReportType,datasetId,datasetWorkspaceId ;
foreach ($r in $reports)
{
Write-Host "Check for report: $($r.name)" -ForegroundColor Yellow
if ($r.datasetId){

$dbdetails = (Invoke-PowerBIRestMethod -Method GET -Url "groups/$($r.datasetWorkspaceId)/datasets/$($r.datasetId)/Datasources" | ConvertFrom-Json).value

Write-Host "Checking Dataset for $($r.datasetId)" -ForegroundColor Yellow
$datasetsources= $dbdetails | Select-Object datasourceType,connectionDetails
if ($datasetsources.count -ge 2){
foreach( $datasrc in $datasetsources){
CheckConnectionString $workspaceID $workSpaceName $r.name $r.datasetId $r.datasetWorkspaceId $datasrc
}
}else{
if ($datasetsources) {
CheckConnectionString $workspaceID $workSpaceName $r.name $r.datasetId $r.datasetWorkspaceId $datasetsources
}else{
Write-Host "No datasource found for $($r.datasetId)"`n -ForegroundColor Red
}
}

 

}else{
if ($r.reportType -eq 'PaginatedReport'){
Write-Host "$($r.name) iS paginated report no datasource detail found"
}else{
}
Write-Host "$($r.name) doesn't have dataset" -ForegroundColor Red
}

 

}
Write-Host
}

1 REPLY 1
lbendlin
Super User
Super User

Are you getting 429's ?  You may be hitting the daily API call allowance.

 

You may want to look at the new scanner API that has recently been announced.

Scanner API is now in GA | Microsoft Power BI Blog | Microsoft Power BI

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.