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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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