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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
RGI
Helper III
Helper III

Powershell scripts to list all entities

Does anyone have a set of Powershell scripts that can be used to list all workspaces with dashboards, reports and datasets?

I'm hoping someone can save me the effort of building it myself.

Basically I'm wanting to list everything that an organisation has created so we can do a cleanup.

 

5 REPLIES 5
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @RGI,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Dale

With all due respect if you read my original post you'll see that there is not yet a solution- just a link (by you) to commands we already know about. I was hoping there is a "ready" set of scripts that show all elements (i.e. all workspaces, all data sets within the said workspaces and all reports linked to those data sets). I've basically been building them myself, assuming nobody has such a set to share with me.

Hi @RGI,

 

Maybe something isn't that clear. Since the PowerShell script is many commands, we can just log in the Power BI and send a command. Then we can get the result. Please refer to the snapshot below.

Maybe you'd like a piece of organized script to get everything?

Powershell-scripts-to-list-all-entities

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


@v-jiascu-msft wrote:Maybe you'd like a piece of organized script to get everything?

 

Yes. Something like this (which I import into Excel and use vlookup)

 

 cls

 $tentantWorkspaces = Get-PowerBIWorkspace -Scope Organization -Filter ("tolower(type) eq 'group'")

Write-Host "There are --" $tentantWorkspaces.Count "-- workspaces in this Power BI tenant."

$spaces = Get-PowerBIWorkspace -Scope Organization -Filter ("tolower(type) eq 'group'")

foreach ($space in $spaces)

{

    write-host $space.Id "|" $space.Name "|" $space.Type "|" $space.State "|" $space.IsOnDedicatedCapacity "|" $space.CapacityId

} 

$dss = Get-PowerBIDataset -Scope Organization

foreach ($ds in $dss)

{

    Write-Host "|"$ds.Id "|" $ds.name "|" $ds.ConfiguredBy "|" $ds.IsOnPremGatewayRequired

}

 $reports = Get-PowerBIReport -Scope Organization

foreach ($report in $reports)

{

    Write-Host "|"$report.Id "|" $report.name "|" $report.DatasetId

} 

 

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @RGI,

 

You don't need to write any codes. There is a PowerShell module for Power BI. You just need to send some commands. Please refer to announcing-apis-and-powershell-cmdlets-for-power-bi-administrators/ and powershell/module/microsoftpowerbimgmt.data/?view=powerbi-ps.

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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