Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

PowerShell REST APIs - getting list of all reports in the tenant

Hi all, hopefully last noob question on how to best use the REST APIs. I have a requirement I thought would be simple: "list all reports in the entire tenant, and which workspace they live in".   M...
  • ChrisMcAlpine's avatar
    6 years ago

    Dear Scott,

     

    Not sure if anyone has gotten back to you, or if you've solved it yourself, but I recently set up a Tenancy overview report using the Power Shell cmdlets and rest API in Power BI and noticed teh same.

     

    With a bit of investigation i noticed that they aren't acutally DELETED reports, they're Reports that have been Published via APPS as the Report ID and Dataset ID are different to the Reports stored in the Workspace. This is because different versions can exist in both spaces, and an App report doesn't automatically get replaced when publishing a new report to a workspace. 

     

    I found this out by using the cmdlet Invoke-PowerBIRestMethod -url 'Apps' -Method Get to retrieve published apps and their reports. 

    It's also worth noting that this only occurs when using the -scope Organization on Get-Reports. 

     

    The way i dealt with this was those ReportID's that matched when using the invoke-powerbirestmethod were published reports and datasets, those that didn't were Workspace Reports (unpublished). This gave me a much cleaner overview of the tenancy.

     

    Hope this helps.


    Chris