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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
richoking
New Member

PowerShell Invoke-PowerBIRestMethod -Method POST -Body workspaces getinfo

Hello,

 

Just after some assistance with the Invoke-PowerBIRestMethod PowerShell command as I'm trying replicate this with the URI parameters as per link:

 

Admin - WorkspaceInfo PostWorkspaceInfo - REST API (Power BI Power BI REST APIs) | Microsoft Docs

 

So the command I have as follows:

 

$body = '{"workspaces": ["workspaceID"
,"workspaceID"]}'

Invoke-PowerBIRestMethod -Url 'https://api.powerbi.com/v1.0/myorg/admin/workspaces/getInfo?lineage=True&datasourceDetails=True&data...' -Method POST -Body $body

 

This sucessfully gives me a scan ID to obtain a scan result, which I then run as:

 

Invoke-PowerBIRestMethod -Url 'https://api.powerbi.com/v1.0/myorg/admin/workspaces/scanResult/{scanID}' -Method GET | ConvertFrom-Json | ConvertTo-Json | Out-File C:\Temp\WorkSpace_OutPut.json

 

This sucessfully output's the json file however when I view the contents I'm missing the following data as shown:

 

richoking_1-1658352678509.png

 

Missing "reports"

"dashboards"

"datasets"

etc.

 

This is what I'm after from Admin - WorkspaceInfo GetScanResult - REST API (Power BI Power BI REST APIs) | Microsoft Docs as shown:

richoking_0-1658352564416.png

 

Any assistance would be greatly appreciated.

 

Thanks.

3 REPLIES 3
richoking
New Member

Hi @GilbertQ I have confirmed that this is enabled in our tenant as per 

richoking_0-1658356406153.png

Thanks,

Hi @richoking 

Could it be that something is missing the in API call?

 

I have used the following Power Automate flow which has worked well for me.

 

Using the Power BI Scanner API to Manage Tenant's Entire Metadata -





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

GilbertQ
Super User
Super User

Hi @richoking 

 

As oer the link you sent through, can you confirm that you have got the metadata scanning enabled

 

GilbertQ_0-1658354259240.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.