Saturday, July 28, 2018

Enumerating Datasets and Reports in Power Bi Tenant

Below is how you enumerate through the datasets and reports in a power bi tenant.
  1. 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
    Power BI admin Management cmdlts installation

    .
  2. 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 }}
  3. 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 }

1 comment:

  1. I think Power BI is the best tool to provide some more information about complex IT problems and solutions.

    Powerbi Read Rest

    ReplyDelete

If you liked the post, please share it.
Subscribe to your email and receive new articles on your email