Many government customers have large O365 tenants with multiple workspaces for departments, agencies and groups needing some way to determine what uses have deployed and where those reports are being shared. Our team has created an easy to use PowerShell API function for running REST API calls. You will first need to open a PowerShell command prompt and install the Management models using this command.
Install-Module -Name MicrosoftPowerBIMgmt -Scope CurrentUser
With the new modules installed in PowerShell, you will then authenticate to you O365 government tenant with the following command. Notice the Environment attribute that is added to the end of the connect function.
Connect-PowerBIServiceAccount -Environment USGov
Finally you will run the invoke method and call the Admin rest API for Get-Groups with the additional Expand properties for reports, dashboards, datasets, users and dataflows. Make sure to properly change the file output to a local file as you will need it for a report template file provided in this Github location. You will need to be an O365 admin or Power BI Admin to run this command.
Invoke-PowerBIRestMethod -Url ‘admin/groups?$top=5000&$skip=0&$expand=reports,dashboards,datasets,users,dataflows’ -Method GET | Out-File “C:\MyPathHere\PowerBIResults.json”
The provided AdminTenantReport template will just need to be updated with your specific file output. Hoping this helps with administration and tenant level inventory efforts for government or large institutions.