Below is how you enumerate through the datasets and reports in a power bi tenant.
- Install the Power Bi Management cmdlts and login to your power bi
Download the power bi Management cmdlts from here. click on the deploy button as shown in the image below and login using your Power Bi admin account
. - Enumerate through all datasets that uses SQL server database
Use the Get-PowerBIDataset and Get-PowerBIDatasource to the enumerate through the data sets. Below is how the power shell should look like:$datasetIds = Get-PowerBIDataset -Scope Organization -ErrorAction SilentlyContinue | Foreach {$dsId = $_.Id; Get-PowerBIDatasource -DatasetId $dsId -Scope Organization -ErrorAction SilentlyContinue | Where-Object {$_.DatasourceType -eq 'Sql' -and ($_.ConnectionDetails.Server -like 'sqldb01' -and $_.ConnectionDetails.Database -like 'DBNAME')} | Foreach { $dsId }} - Enumerate all reports that use the identified datasets
Using the dataset IDs found in the step 2, enumerate through the all the reports which are using the datasets$reports = $datasetIds | Foreach { Get-PowerBIReport -Filter "datasetId eq '$_'" -Scope Organization }
I think Power BI is the best tool to provide some more information about complex IT problems and solutions.
ReplyDeletePowerbi Read Rest